gameexec.c: in VM_Fall(), comment out dead code, small indentation change.

git-svn-id: https://svn.eduke32.com/eduke32@3684 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-04-15 10:48:22 +00:00
parent 0db0587731
commit bac1a3ff63

View file

@ -858,77 +858,81 @@ static int32_t VM_AddWeapon(int32_t weap, int32_t amount, DukePlayer_t *ps)
static void VM_Fall(int32_t g_i, spritetype *g_sp) static void VM_Fall(int32_t g_i, spritetype *g_sp)
{ {
int32_t grav = g_spriteGravity;
g_sp->xoffset = g_sp->yoffset = 0; g_sp->xoffset = g_sp->yoffset = 0;
if (G_CheckForSpaceCeiling(g_sp->sectnum) || sector[g_sp->sectnum].lotag == ST_2_UNDERWATER)
grav = g_spriteGravity/6;
else if (G_CheckForSpaceFloor(g_sp->sectnum))
grav = 0;
if (!actor[g_i].cgg-- || (sector[g_sp->sectnum].floorstat&2))
{ {
int32_t j = g_spriteGravity; A_GetZLimits(g_i);
actor[g_i].cgg = 3;
}
if (G_CheckForSpaceCeiling(g_sp->sectnum) || sector[g_sp->sectnum].lotag == ST_2_UNDERWATER) if (g_sp->z < actor[g_i].floorz-ZOFFSET)
j = g_spriteGravity/6; {
else if (G_CheckForSpaceFloor(g_sp->sectnum)) // Free fall.
j = 0; g_sp->zvel = min(g_sp->zvel+grav, ACTOR_MAXFALLINGZVEL);
g_sp->z += g_sp->zvel;
if (!actor[g_i].cgg-- || (sector[g_sp->sectnum].floorstat&2))
{
A_GetZLimits(g_i);
actor[g_i].cgg = 3;
}
if (g_sp->z < actor[g_i].floorz-ZOFFSET)
{
g_sp->zvel = min(g_sp->zvel+j, ACTOR_MAXFALLINGZVEL);
g_sp->z += g_sp->zvel;
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
if (yax_getbunch(g_sp->sectnum, YAX_FLOOR) >= 0 && if (yax_getbunch(g_sp->sectnum, YAX_FLOOR) >= 0 &&
(sector[g_sp->sectnum].floorstat&512)==0) (sector[g_sp->sectnum].floorstat&512)==0)
setspritez(g_i, (vec3_t *)g_sp); setspritez(g_i, (vec3_t *)g_sp);
else else
#endif #endif
if (g_sp->z > actor[g_i].floorz - ZOFFSET) if (g_sp->z > actor[g_i].floorz - ZOFFSET)
g_sp->z = actor[g_i].floorz - ZOFFSET; g_sp->z = actor[g_i].floorz - ZOFFSET;
return; return;
} }
g_sp->z = actor[g_i].floorz - ZOFFSET; // SET_SPRITE_Z
g_sp->z = actor[g_i].floorz - ZOFFSET;
if (A_CheckEnemySprite(g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0)) if (A_CheckEnemySprite(g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0))
{
if (g_sp->zvel > 3084 && g_sp->extra <= 1)
{ {
if (g_sp->zvel > 3084 && g_sp->extra <= 1) // I'm guessing this DRONE check is from a beta version of the game
// where they crashed into the ground when killed
if (!(g_sp->picnum == APLAYER && g_sp->extra > 0) && g_sp->pal != 1 && g_sp->picnum != DRONE)
{ {
// I'm guessing this DRONE check is from a beta version of the game A_DoGuts(g_i,JIBS6,15);
// where they crashed into the ground when killed A_PlaySound(SQUISHED,g_i);
if (!(g_sp->picnum == APLAYER && g_sp->extra > 0) && g_sp->pal != 1 && g_sp->picnum != DRONE) A_Spawn(g_i,BLOODPOOL);
{
A_DoGuts(g_i,JIBS6,15);
A_PlaySound(SQUISHED,g_i);
A_Spawn(g_i,BLOODPOOL);
}
actor[g_i].picnum = SHOTSPARK1;
actor[g_i].extra = 1;
g_sp->zvel = 0;
} }
else if (g_sp->zvel > 2048 && sector[g_sp->sectnum].lotag != ST_1_ABOVE_WATER)
{
int16_t newsect = g_sp->sectnum;
pushmove((vec3_t *)g_sp, &newsect, 128, 4<<8, 4<<8, CLIPMASK0); actor[g_i].picnum = SHOTSPARK1;
if ((unsigned)newsect < MAXSECTORS) actor[g_i].extra = 1;
changespritesect(g_i, newsect); g_sp->zvel = 0;
}
else if (g_sp->zvel > 2048 && sector[g_sp->sectnum].lotag != ST_1_ABOVE_WATER)
{
int16_t newsect = g_sp->sectnum;
A_PlaySound(THUD, g_i); pushmove((vec3_t *)g_sp, &newsect, 128, 4<<8, 4<<8, CLIPMASK0);
} if ((unsigned)newsect < MAXSECTORS)
changespritesect(g_i, newsect);
A_PlaySound(THUD, g_i);
} }
} }
if (g_sp->z > (actor[g_i].floorz - ZOFFSET)) #if 0
if (g_sp->z > actor[g_i].floorz - ZOFFSET)
{ {
// Unreachable because of SET_SPRITE_Z.
A_GetZLimits(g_i); A_GetZLimits(g_i);
if (actor[g_i].floorz != sector[g_sp->sectnum].floorz) if (actor[g_i].floorz != sector[g_sp->sectnum].floorz)
g_sp->z = (actor[g_i].floorz - ZOFFSET); g_sp->z = (actor[g_i].floorz - ZOFFSET);
return; return;
} }
else if (sector[g_sp->sectnum].lotag == ST_1_ABOVE_WATER) #endif
if (sector[g_sp->sectnum].lotag == ST_1_ABOVE_WATER)
{ {
switch (DYNAMICTILEMAP(g_sp->picnum)) switch (DYNAMICTILEMAP(g_sp->picnum))
{ {
@ -942,7 +946,6 @@ static void VM_Fall(int32_t g_i, spritetype *g_sp)
#if !defined LUNATIC #if !defined LUNATIC
int32_t moveScriptOfs = vm.g_t[1]; int32_t moveScriptOfs = vm.g_t[1];
#endif #endif
// fix for flying/jumping monsters getting stuck in water // fix for flying/jumping monsters getting stuck in water
if ((g_sp->hitag & jumptoplayer) || if ((g_sp->hitag & jumptoplayer) ||
(G_HaveActor(g_sp->picnum) && (G_HaveActor(g_sp->picnum) &&