Fix of potential array-index-out-of-bounds when vict->in_room is NOWHERE. See http://www.tbamud.com/forum/4-development/4148-skill-stun-wierd-problem#6321

This commit is contained in:
Thomas Arp 2016-11-27 21:53:44 +01:00 committed by wyld-sw
parent d6ef378e4f
commit b5ac9f1dfb

View file

@ -305,7 +305,7 @@ void script_damage(struct char_data *vict, int dam)
if (GET_POS(vict) == POS_DEAD) { if (GET_POS(vict) == POS_DEAD) {
if (!IS_NPC(vict)) if (!IS_NPC(vict))
mudlog( BRF, 0, TRUE, "%s killed by script at %s", mudlog( BRF, 0, TRUE, "%s killed by script at %s",
GET_NAME(vict), world[vict->in_room].name); GET_NAME(vict), vict->in_room == NOWHERE ? "NOWHERE" : world[vict->in_room].name);
die(vict, NULL); die(vict, NULL);
} }
} }