From 219b3204ddcd25dcbf2638faf6cb05a39d2e251a Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 7 Aug 2010 22:38:15 +0000 Subject: [PATCH] Fix bugs for DarkDefender git-svn-id: https://svn.eduke32.com/eduke32@1684 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gameexec.c | 9 +++++---- polymer/eduke32/source/player.c | 8 +++----- 2 files changed, 8 insertions(+), 9 deletions(-) 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);