add mobj islocal field

so we can skip the pushable trigger stuff for local mobjs for synch reasons
very sketchy
This commit is contained in:
Alug committed 2025-07-24 22:33:53 +02:00
1 parent a658883664
commit 93cbba218a
4 files changed
+10 -7

No files matched your search

+6 -5
View File
@@ -3081,14 +3081,12 @@ static void K_SpawnDriftSparks(player_t *player)
if (leveltime % 2 == 1)
return;
if (cv_airsparks.value)
goto skipground;
const boolean onground = P_IsObjectOnGround(player->mo);
if (!P_IsObjectOnGround(player->mo))
// kinda sketchy
if (!cv_airsparks.value && onground)
return;
skipground: // idk im sleepy
if (!player->kartstuff[k_drift] || player->kartstuff[k_driftcharge] < K_GetKartDriftSparkValue(player))
return;
@@ -3105,6 +3103,8 @@ skipground: // idk im sleepy
newy = player->mo->y + P_ReturnThrustY(player->mo, thrustangle, smolscale);
spark = P_SpawnMobj(newx, newy, player->mo->z, MT_DRIFTSPARK);
spark->islocal = cv_airsparks.value && !onground;
P_SetTarget(&spark->target, player->mo);
spark->angle = travelangle-(ANGLE_45/5)*player->kartstuff[k_drift];
@@ -5361,6 +5361,7 @@ FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, bool
fast->momx = 3*player->mo->momx/4;
fast->momy = 3*player->mo->momy/4;
fast->momz = 3*player->mo->momz/4;
fast->islocal = !synched;
P_SetTarget(&fast->target, player->mo); // easier lua access
K_MatchGenericExtraFlags(fast, player->mo);
+2 -1
View File
@@ -150,7 +150,8 @@ static const udata_field_t mobj_fields[] = {
FIELD(mobj_t, cvmem, udatalib_getter_int32, udatalib_setter_int32),
FIELD(mobj_t, standingslope, udatalib_getter_slope, mobj_standingslope_noset),
FIELD(mobj_t, colorized, udatalib_getter_boolean, udatalib_setter_boolean),
FIELD(mobj_t, mirrored, udatalib_getter_boolean, udatalib_setter_boolean),
FIELD(mobj_t, mirrored, udatalib_getter_boolean, udatalib_setter_boolean),
FIELD(mobj_t, islocal, udatalib_getter_boolean, udatalib_setter_boolean),
{ NULL, 0, NULL, NULL },
};
#undef FIELD
+1 -1
View File
@@ -6089,7 +6089,7 @@ void P_MobjThinker(mobj_t *mobj)
const sector_t *sec1 = mobj->subsector ? mobj->subsector->sector : NULL;
// 970 allows ANY mobj to trigger a linedef exec
if (UNLIKELY(sec1 && GETSECSPECIAL(sec1->special, 2) == 8))
if (UNLIKELY(!mobj->islocal && sec1 && GETSECSPECIAL(sec1->special, 2) == 8)) // BEWARE: islocal does not exist in vanilla
{
sector_t *sec2;
sec2 = P_ThingOnSpecial3DFloor(mobj);
+1
View File
@@ -414,6 +414,7 @@ typedef struct mobj_s
boolean init_salty;
// WARNING: New fields must be added separately to savegame and Lua.
boolean islocal; // BEWARE: islocal does not exist in vanilla, strictly to be used for locally loaded addons to not cause desynchs with the mobj linedef trigger check. DO NOT USE THIS IN ACTUAL ADDONS YOU INTEND TO USE ON YOUR SERVER
} mobj_t;
//