From 0bdbc463c07ef7626d4db96ca97bb63b23383501 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 14 Nov 2016 23:47:11 +0000 Subject: [PATCH] Fixes issue with picnum 0 sprites used as map geometry git-svn-id: https://svn.eduke32.com/eduke32@5933 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 2a44aa780..05cba7c00 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -8184,11 +8184,15 @@ void A_PlayAlertSound(int spriteNum) int A_CheckSwitchTile(int spriteNum) { // picnum 0 would oob in the switch below, + + if (PN(spriteNum) <= 0) + return 0; + // MULTISWITCH has 4 states so deal with it separately, // ACCESSSWITCH and ACCESSSWITCH2 are only active in one state so deal with // them separately. - if ((PN(spriteNum) <= 0) || (PN(spriteNum) >= MULTISWITCH && PN(spriteNum) <= MULTISWITCH + 3) || (PN(spriteNum) == ACCESSSWITCH || PN(spriteNum) == ACCESSSWITCH2)) + if ((PN(spriteNum) >= MULTISWITCH && PN(spriteNum) <= MULTISWITCH + 3) || (PN(spriteNum) == ACCESSSWITCH || PN(spriteNum) == ACCESSSWITCH2)) return 1; // Loop to catch both states of switches.