mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-23 20:31:06 +00:00
Revert "Remove unnecessary precipmobj thinker hack"
This reverts commit 0e38208620d19ec2ab690740438ac2fc7862a49e.
This commit is contained in:
parent
aec527cb4c
commit
833777d773
4 changed files with 28 additions and 4 deletions
|
@ -5614,6 +5614,16 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
vis->gz = vis->gzt - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height);
|
||||
|
||||
vis->precip = true;
|
||||
|
||||
// okay... this is a hack, but weather isn't networked, so it should be ok
|
||||
if (!(thing->precipflags & PCF_THUNK))
|
||||
{
|
||||
if (thing->precipflags & PCF_RAIN)
|
||||
P_RainThinker(thing);
|
||||
else
|
||||
P_SnowThinker(thing);
|
||||
thing->precipflags |= PCF_THUNK;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4022,7 +4022,8 @@ void P_RecalcPrecipInSector(sector_t *sector)
|
|||
//
|
||||
void P_NullPrecipThinker(precipmobj_t *mobj)
|
||||
{
|
||||
(void)mobj;
|
||||
//(void)mobj;
|
||||
mobj->precipflags &= ~PCF_THUNK;
|
||||
}
|
||||
|
||||
void P_SnowThinker(precipmobj_t *mobj)
|
||||
|
@ -10963,14 +10964,14 @@ static inline precipmobj_t *P_SpawnRainMobj(fixed_t x, fixed_t y, fixed_t z, mob
|
|||
{
|
||||
precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type);
|
||||
mo->precipflags |= PCF_RAIN;
|
||||
mo->thinker.function.acp1 = (actionf_p1)P_RainThinker;
|
||||
//mo->thinker.function.acp1 = (actionf_p1)P_RainThinker;
|
||||
return mo;
|
||||
}
|
||||
|
||||
static inline precipmobj_t *P_SpawnSnowMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
{
|
||||
precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type);
|
||||
mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker;
|
||||
//mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker;
|
||||
return mo;
|
||||
}
|
||||
|
||||
|
|
|
@ -269,6 +269,8 @@ typedef enum {
|
|||
PCF_MOVINGFOF = 8,
|
||||
// Is rain.
|
||||
PCF_RAIN = 16,
|
||||
// Ran the thinker this tic.
|
||||
PCF_THUNK = 32,
|
||||
} precipflag_t;
|
||||
|
||||
// Map Object definition.
|
||||
|
|
|
@ -2264,7 +2264,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
if (thing->subsector->sector->cullheight)
|
||||
{
|
||||
if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt))
|
||||
return;
|
||||
goto weatherthink;
|
||||
}
|
||||
|
||||
// store information in a vissprite
|
||||
|
@ -2318,6 +2318,17 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
|
||||
// Fullbright
|
||||
vis->colormap = colormaps;
|
||||
|
||||
weatherthink:
|
||||
// okay... this is a hack, but weather isn't networked, so it should be ok
|
||||
if (!(thing->precipflags & PCF_THUNK))
|
||||
{
|
||||
if (thing->precipflags & PCF_RAIN)
|
||||
P_RainThinker(thing);
|
||||
else
|
||||
P_SnowThinker(thing);
|
||||
thing->precipflags |= PCF_THUNK;
|
||||
}
|
||||
}
|
||||
|
||||
// R_AddSprites
|
||||
|
|
Loading…
Reference in a new issue