dont recalc if precip sector didnt move

forgor i can just check this
This commit is contained in:
Alug committed 2025-03-05 11:13:40 +01:00
1 parent 96f842fd96
commit d397a07d96
1 file changed
+7 -3
+7 -3
View File
@@ -3567,7 +3567,7 @@ animonly:
}
}
static void P_CalculatePrecipFloor(precipmobj_t *mobj)
static void P_CalculatePrecipFloor(precipmobj_t *mobj, boolean spawn)
{
// recalculate floorz each time
const sector_t *mobjsecsubsec;
@@ -3577,6 +3577,10 @@ static void P_CalculatePrecipFloor(precipmobj_t *mobj)
else
return;
// no need to recalc anything if not moved
if (!spawn && !mobjsecsubsec->moved)
return;
mobj->floorz = P_GetSectorFloorZAt(mobjsecsubsec, mobj->x, mobj->y);
if (mobjsecsubsec->ffloors)
@@ -3668,7 +3672,7 @@ boolean P_PrecipThinker(precipmobj_t *mobj)
return true;
if (renderisnewtic)
P_CalculatePrecipFloor(mobj);
P_CalculatePrecipFloor(mobj, false);
// adjust height
if ((mobj->z += mobj->momz) <= mobj->floorz)
@@ -10037,7 +10041,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
mobj->thinker.function.acp1 = (actionf_p1)P_NullPrecipThinker;
P_AddPrecipThinker(&mobj->thinker);
P_CalculatePrecipFloor(mobj);
P_CalculatePrecipFloor(mobj, true);
if (mobj->floorz != starting_floorz)
mobj->precipflags |= PCF_FOF;