Prevent segfault in can_blnd
This commit is contained in:
@@ -182,7 +182,9 @@ struct monst *mon;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* True iff monster can be blinded by the given attack;
|
/* True iff monster can be blinded by the given attack;
|
||||||
note: may return True when mdef is blind (e.g. new cream-pie attack) */
|
note: may return True when mdef is blind (e.g. new cream-pie attack)
|
||||||
|
magr can be NULL.
|
||||||
|
*/
|
||||||
boolean
|
boolean
|
||||||
can_blnd(magr, mdef, aatyp, obj)
|
can_blnd(magr, mdef, aatyp, obj)
|
||||||
struct monst *magr; /* NULL == no specific aggressor */
|
struct monst *magr; /* NULL == no specific aggressor */
|
||||||
@@ -203,7 +205,7 @@ struct obj *obj; /* aatyp == AT_WEAP, AT_SPIT */
|
|||||||
a saying expressed in Latin rather than a zoological observation:
|
a saying expressed in Latin rather than a zoological observation:
|
||||||
"a crow will not pluck out the eye of another crow"
|
"a crow will not pluck out the eye of another crow"
|
||||||
so prevent ravens from blinding each other */
|
so prevent ravens from blinding each other */
|
||||||
if (magr->data == &mons[PM_RAVEN] && mdef->data == &mons[PM_RAVEN])
|
if (magr && magr->data == &mons[PM_RAVEN] && mdef->data == &mons[PM_RAVEN])
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
switch (aatyp) {
|
switch (aatyp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user