Eliminate unnecessary goto

git-svn-id: https://svn.eduke32.com/eduke32@8731 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2020-03-12 01:05:40 +00:00 committed by Christoph Oelckers
parent 2e17467a8f
commit 21ec33ac51

View file

@ -671,31 +671,30 @@ GAMEEXEC_STATIC void VM_Move(void)
return;
}
if (deadflag)
goto dead;
if (movflags&face_player)
VM_FacePlayer(2);
if (movflags&spin)
vm.pSprite->ang += sintable[((AC_COUNT(vm.pData)<<3)&2047)]>>6;
if (movflags&face_player_slow)
VM_FacePlayer(4);
if ((movflags&jumptoplayer_bits) == jumptoplayer_bits)
if (!deadflag)
{
if (AC_COUNT(vm.pData) < 16)
vm.pSprite->zvel -= (sintable[(512+(AC_COUNT(vm.pData)<<4))&2047]>>5);
if (movflags & face_player)
VM_FacePlayer(2);
if (movflags & spin)
vm.pSprite->ang += sintable[((AC_COUNT(vm.pData) << 3) & 2047)] >> 6;
if (movflags & face_player_slow)
VM_FacePlayer(4);
if ((movflags & jumptoplayer_bits) == jumptoplayer_bits)
{
if (AC_COUNT(vm.pData) < 16)
vm.pSprite->zvel -= (sintable[(512 + (AC_COUNT(vm.pData) << 4)) & 2047] >> 5);
}
if (movflags & face_player_smart)
{
vec2_t const vect = { vm.pPlayer->pos.x + (vm.pPlayer->vel.x / 768), vm.pPlayer->pos.y + (vm.pPlayer->vel.y / 768) };
VM_AddAngle(2, getangle(vect.x - vm.pSprite->x, vect.y - vm.pSprite->y));
}
}
if (movflags&face_player_smart)
{
vec2_t const vect = { vm.pPlayer->pos.x + (vm.pPlayer->vel.x / 768), vm.pPlayer->pos.y + (vm.pPlayer->vel.y / 768) };
VM_AddAngle(2, getangle(vect.x - vm.pSprite->x, vect.y - vm.pSprite->y));
}
dead:
#if !defined LUNATIC
if (EDUKE32_PREDICT_FALSE((unsigned)AC_MOVE_ID(vm.pData) >= (unsigned)g_scriptSize-1))
{