fix #K3564 - obj sanity failure: N globs for N>1
Using #name and picking an item on the floor to be assigned a type name allowed any of the four types of globs to be named. After that, wishing for those by the assigned name bypassed the code that forced the quantity to stay at 1. Asking for "3 foo" could then produce "3 small globs of gray ooze" which fails obj_sanity() and issues an impossible warning (which the fuzzer escalates to panic). The "getobj refactor" patch changed the return value of call_ok(). When it gets used to check whether an object on the floor could have a type name assigned (rather than as a getobj() callback), the test that should have rejected the naming attempt accepted it instead. Update the wishing code to handle globs differently: you can still specify the relative size via small, medium, large, or very large, but now you can specify a count either instead or in addition. A count of more than 1 is used to multiply the created glob's weight, although it's less likely to be honored as-is when the size is bigger than small. Quantity is always forced to 1, at a different place in readobjnam() than previously.
This commit is contained in:
@@ -1000,6 +1000,9 @@ if an invisible hero managed to convert an unaligned altar to an aligned one
|
||||
with color enabled, altar wasn't immediately redrawn with new color
|
||||
repair some regressions to (a)pply introduced by "getobj refactor" patch
|
||||
getobj too: allow attempting to (E)ngrave with any item in inventory
|
||||
getobj refactor also allowed non-nameable items on floor to be assigned names
|
||||
exploting the bug to assign type name to glob on floor allowed wishing for
|
||||
"N assigned-glob-name" to create a glob with quantity N instead of 1
|
||||
fix ^X feedback when held typo: "unseen createure" -> "unseen creature"
|
||||
if a <foo> corpse was set to revive as a <foo> zombie and corpse was partly
|
||||
eaten at revival time and monster <foo> is defined as providing more
|
||||
|
||||
Reference in New Issue
Block a user