some tilemap.c cleanup

I'm headed back to the drawing board for some tiles changes I was
attempting, but before tossing what I had I've extracted a modest
amount of cleanup for the code in win/share/tilemap.c.  Some
formatting, a bit of generated formatting, make ENHANCED_SYMBOLS
less intrusive, and an error check to prevent a crash in tilemap
I triggered.  Also avoid one in nethack caused by an object (not
included here) which had a description but no name.
This commit is contained in:
PatR
2022-12-30 12:45:02 -08:00
parent 11b72eb18b
commit 8397b15d83
2 changed files with 61 additions and 51 deletions

View File

@@ -789,11 +789,11 @@ parse_id(const char *id, struct find_struct *findwhat)
else if (i == LAND_MINE)
buf2 = "unset ";
buf3 = (i == SCR_BLANK_PAPER) ? "blank scroll"
: (i == SPE_BLANK_PAPER)
? "blank spellbook"
: (i == SLIME_MOLD)
? "slime mold"
: obj_descr[i].oc_name;
: (i == SPE_BLANK_PAPER) ? "blank spellbook"
: (i == SLIME_MOLD) ? "slime mold"
: obj_descr[i].oc_name
? obj_descr[i].oc_name
: obj_descr[i].oc_descr;
Strcpy(buf[0], "G_");
if (glyph_is_normal_piletop_obj(glyph))
Strcat(buf[0], "piletop_");