Fix several touchstone-related things:
1. The switch statement was using the material "GOLD" rather than GOLD_CLASS. 2. If getobj() had been working for gold when it came to touchstones, there would have been a memory leak here because the object returned would have been from mkgoldobj(). The goldobj was not being freed anywhere, nor was it being put on a chain. You also would have had zero gold after rubbing it on the stone. The intent was clearly to allow gold since there was a case in the switch statement. 3. getobj() wasn't working properly for gold selection here anyway, so this was not the cause of <Someone>'s gold obj in inventory. You ended up dropping through to code that was supposed to print "You cannot verb object." For touchstones that came out as: "You cannot rub on the stone gold."
This commit is contained in:
@@ -729,6 +729,10 @@ register const char *let,*word;
|
||||
#else
|
||||
if(*let == GOLD_CLASS) let++, usegold = TRUE;
|
||||
#endif
|
||||
/* Ugly check for touchstone */
|
||||
if (!strncmp(word, "rub on", 6) && u.ugold)
|
||||
allowgold = usegold = TRUE;
|
||||
|
||||
/* Equivalent of an "ugly check" for gold */
|
||||
if (usegold && !strcmp(word, "eat") && !metallivorous(youmonst.data))
|
||||
#ifndef GOLDOBJ
|
||||
|
||||
Reference in New Issue
Block a user