diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 8f42fb399..d4d9345d3 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -510,10 +510,11 @@ GAMEEXEC_STATIC void VM_Move(void) vm.g_sp->ang += angdif; } - moveptr = (intptr_t *)vm.g_t[1]; - - if (a&geth) vm.g_sp->xvel += ((*moveptr)-vm.g_sp->xvel)>>1; - if (a&getv) vm.g_sp->zvel += ((*(moveptr+1)<<4)-vm.g_sp->zvel)>>1; + if ((moveptr = (intptr_t *)vm.g_t[1]) >= &script[0] && moveptr <= (&script[0]+g_scriptSize)) + { + if (a&geth) vm.g_sp->xvel += ((*moveptr)-vm.g_sp->xvel)>>1; + if (a&getv) vm.g_sp->zvel += ((*(moveptr+1)<<4)-vm.g_sp->zvel)>>1; + } if (a&dodgebullet && !deadflag) A_Dodge(vm.g_sp); diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index f6ef8cf56..a4964e4c5 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -4291,13 +4291,11 @@ void P_ProcessWeapon(int32_t snum) p->pos.z = p->opos.z; p->posvel.z = 0; } + if (*kb == aplWeaponSound2Time[p->curr_weapon][snum]) - { - if (aplWeaponSound2Sound[p->curr_weapon][snum]) - { + if (aplWeaponSound2Sound[p->curr_weapon][snum] > 0) A_PlaySound(aplWeaponSound2Sound[p->curr_weapon][snum],p->i); - } - } + if (*kb == aplWeaponSpawnTime[p->curr_weapon][snum]) P_DoWeaponSpawn(p);