From 443c81e67a522ac4a9d91f936314936c98391669 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 16 Jul 2016 00:49:58 -0400 Subject: [PATCH] extra sanity check (was needed in my mod) --- src/simulation/elements/STKM.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp index 316291876..cd17c14b9 100644 --- a/src/simulation/elements/STKM.cpp +++ b/src/simulation/elements/STKM.cpp @@ -348,9 +348,11 @@ int Element_STKM::run_stickman(playerst *playerp, UPDATE_FUNC_ARGS) { } //Charge detector wall if foot inside - if (sim->bmap[(int)(playerp->legs[5]+0.5)/CELL][(int)(playerp->legs[4]+0.5)/CELL]==WL_DETECT) + if (INBOND((int)(playerp->legs[4]+0.5)/CELL, (int)(playerp->legs[5]+0.5)/CELL) && + sim->bmap[(int)(playerp->legs[5]+0.5)/CELL][(int)(playerp->legs[4]+0.5)/CELL]==WL_DETECT) sim->set_emap((int)playerp->legs[4]/CELL, (int)playerp->legs[5]/CELL); - if (sim->bmap[(int)(playerp->legs[13]+0.5)/CELL][(int)(playerp->legs[12]+0.5)/CELL]==WL_DETECT) + if (INBOND((int)(playerp->legs[12]+0.5)/CELL, (int)(playerp->legs[13]+0.5)/CELL) && + sim->bmap[(int)(playerp->legs[13]+0.5)/CELL][(int)(playerp->legs[12]+0.5)/CELL]==WL_DETECT) sim->set_emap((int)(playerp->legs[12]+0.5)/CELL, (int)(playerp->legs[13]+0.5)/CELL); //Searching for particles near head