diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 6338a9175..d78890cdf 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2705,14 +2705,12 @@ CHECKINV1: j = ((sb_snum&(15<>SK_WEAPON_BITS) - 1; - aGameVars[g_iReturnVarID].val.lValue = j; - switch ((int32_t)j) { case -1: break; default: - VM_OnEvent(EVENT_WEAPKEY1+j,p->i,snum, -1, 0); + j = (uint32_t)VM_OnEvent(EVENT_WEAPKEY1+j,p->i,snum, -1, j); break; case 10: VM_OnEvent(EVENT_PREVIOUSWEAPON,p->i,snum, -1, 0); @@ -2722,8 +2720,6 @@ CHECKINV1: break; } - j = (uint32_t) aGameVars[g_iReturnVarID].val.lValue; - if (p->reloading == 1) j = -1; else if ((int32_t)j != -1 && p->kickback_pic == 1 && p->weapon_pos == 1)