mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
Merge branch 'rvz-cleanup' into 'master'
RVZ1 lag reduction See merge request STJr/SRB2Internal!445
This commit is contained in:
commit
41b95437da
3 changed files with 36 additions and 15 deletions
12
src/info.c
12
src/info.c
|
@ -5294,7 +5294,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPTHING|MF_NOBLOCKMAP|MF_RUNSPAWNFUNC, // flags
|
||||
MF_NOGRAVITY|MF_NOCLIPTHING|MF_NOBLOCKMAP|MF_RUNSPAWNFUNC|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -5321,7 +5321,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPTHING|MF_NOBLOCKMAP|MF_RUNSPAWNFUNC, // flags
|
||||
MF_NOGRAVITY|MF_NOCLIPTHING|MF_NOBLOCKMAP|MF_RUNSPAWNFUNC|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -13300,7 +13300,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
3200*FRACUNIT, // speed
|
||||
30*FRACUNIT, // radius
|
||||
32*FRACUNIT, // height
|
||||
1, // display offset
|
||||
|
@ -13388,7 +13388,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_SPAWNCEILING, // flags
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_SPAWNCEILING|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -19038,7 +19038,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL, // deathstate
|
||||
S_PUMA_DOWN3, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
2000*FRACUNIT, // speed
|
||||
8*FRACUNIT, // radius
|
||||
16*FRACUNIT, // height
|
||||
0, // display offset
|
||||
|
@ -19072,7 +19072,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
|
||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
@ -4759,7 +4759,7 @@ void A_DropMine(mobj_t *actor)
|
|||
// Description: Makes the stupid harmless fish in Greenflower Zone jump.
|
||||
//
|
||||
// var1 = Jump strength (in FRACBITS), if specified. Otherwise, uses the angle value.
|
||||
// var2 = unused
|
||||
// var2 = Trail object to spawn, if desired.
|
||||
//
|
||||
void A_FishJump(mobj_t *actor)
|
||||
{
|
||||
|
@ -4772,8 +4772,17 @@ void A_FishJump(mobj_t *actor)
|
|||
|
||||
if (locvar2)
|
||||
{
|
||||
fixed_t rad = actor->radius>>FRACBITS;
|
||||
P_SpawnMobjFromMobj(actor, P_RandomRange(rad, -rad)<<FRACBITS, P_RandomRange(rad, -rad)<<FRACBITS, 0, (mobjtype_t)locvar2);
|
||||
UINT8 i;
|
||||
// Don't spawn trail unless a player is nearby.
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
if (playeringame[i] && players[i].mo
|
||||
&& P_AproxDistance(actor->x - players[i].mo->x, actor->y - players[i].mo->y) < (actor->info->speed))
|
||||
break; // Stop looking.
|
||||
if (i < MAXPLAYERS)
|
||||
{
|
||||
fixed_t rad = actor->radius>>FRACBITS;
|
||||
P_SpawnMobjFromMobj(actor, P_RandomRange(rad, -rad)<<FRACBITS, P_RandomRange(rad, -rad)<<FRACBITS, 0, (mobjtype_t)locvar2);
|
||||
}
|
||||
}
|
||||
|
||||
if ((actor->z <= actor->floorz) || (actor->z <= actor->watertop - FixedMul((64 << FRACBITS), actor->scale)))
|
||||
|
@ -14024,7 +14033,7 @@ void A_LavafallRocks(mobj_t *actor)
|
|||
// Don't spawn rocks unless a player is relatively close by.
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
if (playeringame[i] && players[i].mo
|
||||
&& P_AproxDistance(actor->x - players[i].mo->x, actor->y - players[i].mo->y) < (1600 << FRACBITS))
|
||||
&& P_AproxDistance(actor->x - players[i].mo->x, actor->y - players[i].mo->y) < (actor->info->speed >> 1))
|
||||
break; // Stop looking.
|
||||
|
||||
if (i < MAXPLAYERS)
|
||||
|
@ -14047,6 +14056,7 @@ void A_LavafallRocks(mobj_t *actor)
|
|||
void A_LavafallLava(mobj_t *actor)
|
||||
{
|
||||
mobj_t *lavafall;
|
||||
UINT8 i;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_CallAction("A_LavafallLava", actor))
|
||||
|
@ -14056,6 +14066,15 @@ void A_LavafallLava(mobj_t *actor)
|
|||
if ((40 - actor->fuse) % (2*(actor->scale >> FRACBITS)))
|
||||
return;
|
||||
|
||||
// Don't spawn lava unless a player is nearby.
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
if (playeringame[i] && players[i].mo
|
||||
&& P_AproxDistance(actor->x - players[i].mo->x, actor->y - players[i].mo->y) < (actor->info->speed))
|
||||
break; // Stop looking.
|
||||
|
||||
if (i >= MAXPLAYERS)
|
||||
return;
|
||||
|
||||
lavafall = P_SpawnMobjFromMobj(actor, 0, 0, -8*FRACUNIT, MT_LAVAFALL_LAVA);
|
||||
lavafall->momz = -P_MobjFlip(actor)*25*FRACUNIT;
|
||||
}
|
||||
|
|
12
src/p_mobj.c
12
src/p_mobj.c
|
@ -9429,6 +9429,13 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|
||||
hdist = R_PointToDist2(mobj->x, mobj->y, mobj->target->x, mobj->target->y);
|
||||
|
||||
if (hdist > 1500*FRACUNIT)
|
||||
{
|
||||
mobj->flags2 &= ~MF2_BOSSNOTRAP;
|
||||
P_SetTarget(&mobj->target, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(mobj->flags2 & MF2_BOSSNOTRAP) && hdist <= 450*FRACUNIT)
|
||||
mobj->flags2 |= MF2_BOSSNOTRAP;
|
||||
|
||||
|
@ -9448,11 +9455,6 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
mobj->momx = 0;
|
||||
mobj->momy = 0;
|
||||
mobj->momz = 0;
|
||||
if (hdist >= 1500*FRACUNIT)
|
||||
{
|
||||
mobj->flags2 &= ~MF2_BOSSNOTRAP;
|
||||
P_SetTarget(&mobj->target, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue