The analyzer complained that the second call to Japanese_item_name() might return Null after the first one didn't. | if (Role_if(PM_SAMURAI) && Japanese_item_name(otyp)) | actualnm = Japanese_item_name(otyp); even though the code involved is self-contained and deterministic. Then later in obj_typename() 'actualnm' gets passed to strcat() or strcpy() where Null isn't acceptable. Could probably fix that by caching and reusing the first return value: | if (Role_if(PM_SAMURAI) && (jname = Japanese_item_name(otyp)) != 0) | actualnm = jname; but I went a different route, revising that routine to take a second argument: | if (Role_if(PM_SAMURAI)) | actualnm = Japanese_item_name(otyp, actualnm); It now passes back 'actualnm' instead of Null when no substitution takes place. The recent introduction of generic objects without names meant that 'actualnm' could actually be Null, but generic objects only occur for map glyphs and only when dknown is 0, so the actual-name field shouldn't ever be get used for them. Give actualnm a fallback value just in case. Wishing is a place that loops over all of objects[] so have it skip the generic objects. They're all flagged no-wish so weren't being chosen, but explicitly skipping them makes the intention clear.
189 KiB
189 KiB