Commit 0d722e3
committed
Fix: drop_throw assumed breakobj unconditionally breaks an object
This looks like an omission from post-merge commit 8bb473b. The code
here is specific to xNetHack, having been added fairly early as part of
the object materials system, and was intended to break non-shatterproof
glass missiles to balance their generally superior damage.
However, this code assumed that breakobj would completely delete the
object, an assumption which is no longer true. This caused a fuzzer
crash when breakobj did NOT delete the object, and gt.thrownobj remained
set to it without being cleared. The fix is to check the return of
breakobj and only return early when the object has in fact been deleted.
Otherwise, fall through to the standard missile-fall handling (which
includes the regular chance of glass ammo, like any ammo, mulching and
vanishing without a message).1 parent 5285008 commit 0d722e3
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| |||
0 commit comments