add a pair of shorthand macros to validate an index into an array
Two variations:
IndexOk(idx, array) validate that idx is a valid index into the array
IndexOkT(idx, array) validate that idx is a valid index into the
array, excluding the final Terminator element
This commit is contained in:
@@ -1817,7 +1817,7 @@ m_move(register struct monst *mtmp, int after)
|
||||
* mfndpos) has no effect for normal attacks, though it lets a
|
||||
* confused monster attack you by accident.
|
||||
*/
|
||||
assert(chi >= 0 && chi < SIZE(info));
|
||||
assert(IndexOk(chi, info));
|
||||
if (info[chi] & ALLOW_U) {
|
||||
nix = mtmp->mux;
|
||||
niy = mtmp->muy;
|
||||
|
||||
Reference in New Issue
Block a user