dont recalc if precip sector didnt move

forgor i can just check this
This commit is contained in:
Alug committed 2025-01-27 23:24:01 +01:00
1 parent a4213d0316
commit 34603b9128
1 file changed
+7 -3
+7 -3
View File
@@ -3634,7 +3634,7 @@ animonly:
P_CyclePlayerMobjState(mobj, true);
}
static void P_CalculatePrecipFloor(precipmobj_t *mobj)
static void P_CalculatePrecipFloor(precipmobj_t *mobj, boolean spawn)
{
// recalculate floorz each time
const sector_t *mobjsecsubsec;
@@ -3644,6 +3644,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)
@@ -3735,7 +3739,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)
@@ -10143,7 +10147,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;