make zeroany, zeromonst, zeroobj 'const'
They're never modified. Minor complication: &zeroobj is used as a special not-Null-but-not-an-object value in multiple places and needs to have 'const' removed with a cast in that situation.
This commit is contained in:
16
src/muse.c
16
src/muse.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 muse.c $NHDT-Date: 1539804880 2018/10/17 19:34:40 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.85 $ */
|
||||
/* NetHack 3.6 muse.c $NHDT-Date: 1547025167 2019/01/09 09:12:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.92 $ */
|
||||
/* Copyright (C) 1990 by Ken Arromdee */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -477,7 +477,7 @@ struct monst *mtmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
toot:
|
||||
toot:
|
||||
;
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ struct monst *mtmp;
|
||||
m.has_defense = MUSE_SCR_CREATE_MONSTER;
|
||||
}
|
||||
}
|
||||
botm:
|
||||
botm:
|
||||
return (boolean) !!m.has_defense;
|
||||
#undef nomore
|
||||
}
|
||||
@@ -648,7 +648,7 @@ struct monst *mtmp;
|
||||
mzapmsg(mtmp, otmp, TRUE);
|
||||
otmp->spe--;
|
||||
how = WAN_TELEPORTATION;
|
||||
mon_tele:
|
||||
mon_tele:
|
||||
if (tele_restrict(mtmp)) { /* mysterious force... */
|
||||
if (vismon && how) /* mentions 'teleport' */
|
||||
makeknown(how);
|
||||
@@ -886,7 +886,7 @@ struct monst *mtmp;
|
||||
case MUSE_SSTAIRS:
|
||||
m_flee(mtmp);
|
||||
if (ledger_no(&u.uz) == 1) {
|
||||
escape:
|
||||
escape:
|
||||
/* Monsters without the Amulet escape the dungeon and
|
||||
* are gone for good when they leave up the up stairs.
|
||||
* A monster with the Amulet would leave it behind
|
||||
@@ -995,7 +995,7 @@ struct monst *mtmp;
|
||||
if (is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data)
|
||||
|| pm->mlet == S_GHOST || pm->mlet == S_KOP)
|
||||
return 0;
|
||||
try_again:
|
||||
try_again:
|
||||
switch (rn2(8 + (difficulty > 3) + (difficulty > 6) + (difficulty > 8))) {
|
||||
case 6:
|
||||
case 9:
|
||||
@@ -1791,7 +1791,7 @@ struct monst *mtmp;
|
||||
(coord *) 0);
|
||||
return 2;
|
||||
} else {
|
||||
skipmsg:
|
||||
skipmsg:
|
||||
if (vismon) {
|
||||
pline("%s looks uneasy.", Monnam(mtmp));
|
||||
if (!objects[POT_GAIN_LEVEL].oc_name_known
|
||||
@@ -2412,7 +2412,7 @@ boolean by_you;
|
||||
}
|
||||
}
|
||||
if (t && t->ttyp == FIRE_TRAP)
|
||||
return muse_unslime(mon, &zeroobj, t, by_you);
|
||||
return muse_unslime(mon, (struct obj *) &zeroobj, t, by_you);
|
||||
|
||||
} /* MUSE */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user