mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Reduce RVZ particle spawns when no players are in proximity
This commit is contained in:
parent
96aa11c825
commit
c43551384d
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
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
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
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -5321,7 +5321,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
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
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -13300,7 +13300,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL, // deathstate
|
S_NULL, // deathstate
|
||||||
S_NULL, // xdeathstate
|
S_NULL, // xdeathstate
|
||||||
sfx_None, // deathsound
|
sfx_None, // deathsound
|
||||||
0, // speed
|
3200*FRACUNIT, // speed
|
||||||
30*FRACUNIT, // radius
|
30*FRACUNIT, // radius
|
||||||
32*FRACUNIT, // height
|
32*FRACUNIT, // height
|
||||||
1, // display offset
|
1, // display offset
|
||||||
|
@ -13388,7 +13388,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
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
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -19038,7 +19038,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL, // deathstate
|
S_NULL, // deathstate
|
||||||
S_PUMA_DOWN3, // xdeathstate
|
S_PUMA_DOWN3, // xdeathstate
|
||||||
sfx_None, // deathsound
|
sfx_None, // deathsound
|
||||||
0, // speed
|
2000*FRACUNIT, // speed
|
||||||
8*FRACUNIT, // radius
|
8*FRACUNIT, // radius
|
||||||
16*FRACUNIT, // height
|
16*FRACUNIT, // height
|
||||||
0, // display offset
|
0, // display offset
|
||||||
|
@ -19072,7 +19072,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
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
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -4759,7 +4759,7 @@ void A_DropMine(mobj_t *actor)
|
||||||
// Description: Makes the stupid harmless fish in Greenflower Zone jump.
|
// Description: Makes the stupid harmless fish in Greenflower Zone jump.
|
||||||
//
|
//
|
||||||
// var1 = Jump strength (in FRACBITS), if specified. Otherwise, uses the angle value.
|
// 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)
|
void A_FishJump(mobj_t *actor)
|
||||||
{
|
{
|
||||||
|
@ -4772,8 +4772,17 @@ void A_FishJump(mobj_t *actor)
|
||||||
|
|
||||||
if (locvar2)
|
if (locvar2)
|
||||||
{
|
{
|
||||||
fixed_t rad = actor->radius>>FRACBITS;
|
UINT8 i;
|
||||||
P_SpawnMobjFromMobj(actor, P_RandomRange(rad, -rad)<<FRACBITS, P_RandomRange(rad, -rad)<<FRACBITS, 0, (mobjtype_t)locvar2);
|
// 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)))
|
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.
|
// Don't spawn rocks unless a player is relatively close by.
|
||||||
for (i = 0; i < MAXPLAYERS; ++i)
|
for (i = 0; i < MAXPLAYERS; ++i)
|
||||||
if (playeringame[i] && players[i].mo
|
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.
|
break; // Stop looking.
|
||||||
|
|
||||||
if (i < MAXPLAYERS)
|
if (i < MAXPLAYERS)
|
||||||
|
@ -14047,6 +14056,7 @@ void A_LavafallRocks(mobj_t *actor)
|
||||||
void A_LavafallLava(mobj_t *actor)
|
void A_LavafallLava(mobj_t *actor)
|
||||||
{
|
{
|
||||||
mobj_t *lavafall;
|
mobj_t *lavafall;
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_LavafallLava", actor))
|
if (LUA_CallAction("A_LavafallLava", actor))
|
||||||
|
@ -14056,6 +14066,15 @@ void A_LavafallLava(mobj_t *actor)
|
||||||
if ((40 - actor->fuse) % (2*(actor->scale >> FRACBITS)))
|
if ((40 - actor->fuse) % (2*(actor->scale >> FRACBITS)))
|
||||||
return;
|
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 = P_SpawnMobjFromMobj(actor, 0, 0, -8*FRACUNIT, MT_LAVAFALL_LAVA);
|
||||||
lavafall->momz = -P_MobjFlip(actor)*25*FRACUNIT;
|
lavafall->momz = -P_MobjFlip(actor)*25*FRACUNIT;
|
||||||
}
|
}
|
||||||
|
|
12
src/p_mobj.c
12
src/p_mobj.c
|
@ -9436,6 +9436,13 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
|
|
||||||
hdist = R_PointToDist2(mobj->x, mobj->y, mobj->target->x, mobj->target->y);
|
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)
|
if (!(mobj->flags2 & MF2_BOSSNOTRAP) && hdist <= 450*FRACUNIT)
|
||||||
mobj->flags2 |= MF2_BOSSNOTRAP;
|
mobj->flags2 |= MF2_BOSSNOTRAP;
|
||||||
|
|
||||||
|
@ -9455,11 +9462,6 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
mobj->momx = 0;
|
mobj->momx = 0;
|
||||||
mobj->momy = 0;
|
mobj->momy = 0;
|
||||||
mobj->momz = 0;
|
mobj->momz = 0;
|
||||||
if (hdist >= 1500*FRACUNIT)
|
|
||||||
{
|
|
||||||
mobj->flags2 &= ~MF2_BOSSNOTRAP;
|
|
||||||
P_SetTarget(&mobj->target, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue