remove obj guard from stone_missile(obj) macro
Checking the callers:
toss_up() would have segfaulted prior to use of stone_missile() if obj were NULL.
thitu() now has a guard prior to use of stone_missile()
ohitmon() would have crashed from earlier dereference otmp->dknown if it were NULL,
otmp arg is declared nonnull
thitm() now has a guard prior to use of stone_missile().
hmon_hitmon_do_hit() null obj takes a different code path than the code path
using stone_missile(); comment asserting that added
This commit is contained in:
@@ -257,7 +257,7 @@ struct obj {
|
||||
/* 'missile' aspect is up to the caller and does not imply is_missile();
|
||||
rings might be launched as missiles when being scattered by an explosion */
|
||||
#define stone_missile(o) \
|
||||
((o) && (objects[(o)->otyp].oc_material == GEMSTONE \
|
||||
((objects[(o)->otyp].oc_material == GEMSTONE \
|
||||
|| (objects[(o)->otyp].oc_material == MINERAL)) \
|
||||
&& (o)->oclass != RING_CLASS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user