Consistancy(void): Use TypeIsNetSynced instead of MT_OVERLAY-specific check

In addition, don't use frame - I'm pretty sure this was something we've already violated to no ill effect.
This commit is contained in:
toaster 2023-10-06 22:18:08 +01:00
parent 66c415ea41
commit 6533e7e69f
3 changed files with 15 additions and 10 deletions

View file

@ -5966,6 +5966,9 @@ static INT16 Consistancy(void)
mo = (mobj_t *)th;
if (TypeIsNetSynced(mo->type) == false)
continue;
if (mo->flags & (MF_SPECIAL | MF_SOLID | MF_PUSHABLE | MF_BOSS | MF_MISSILE | MF_SPRING | MF_MONITOR | MF_FIRE | MF_ENEMY | MF_PAIN | MF_STICKY))
{
ret -= mo->type;
@ -5979,7 +5982,7 @@ static INT16 Consistancy(void)
ret -= mo->flags;
ret += mo->flags2;
ret -= mo->eflags;
if (mo->target)
if (mo->target && TypeIsNetSynced(mo->target->type))
{
ret += mo->target->type;
ret -= mo->target->x;
@ -5995,11 +5998,11 @@ static INT16 Consistancy(void)
ret -= mo->target->state - states;
ret += mo->target->tics;
ret -= mo->target->sprite;
ret += mo->target->frame;
//ret += mo->target->frame;
}
else
ret ^= 0x3333;
if (mo->tracer && mo->tracer->type != MT_OVERLAY)
if (mo->tracer && TypeIsNetSynced(mo->tracer->type))
{
ret += mo->tracer->type;
ret -= mo->tracer->x;
@ -6015,12 +6018,12 @@ static INT16 Consistancy(void)
ret -= mo->tracer->state - states;
ret += mo->tracer->tics;
ret -= mo->tracer->sprite;
ret += mo->tracer->frame;
//ret += mo->tracer->frame;
}
else
ret ^= 0xAAAA;
// SRB2Kart: We use hnext & hprev very extensively
if (mo->hnext && mo->hnext->type != MT_OVERLAY)
if (mo->hnext && TypeIsNetSynced(mo->hnext->type))
{
ret += mo->hnext->type;
ret -= mo->hnext->x;
@ -6036,11 +6039,11 @@ static INT16 Consistancy(void)
ret -= mo->hnext->state - states;
ret += mo->hnext->tics;
ret -= mo->hnext->sprite;
ret += mo->hnext->frame;
//ret += mo->hnext->frame;
}
else
ret ^= 0x5555;
if (mo->hprev && mo->hprev->type != MT_OVERLAY)
if (mo->hprev && TypeIsNetSynced(mo->hprev->type))
{
ret += mo->hprev->type;
ret -= mo->hprev->x;
@ -6056,14 +6059,14 @@ static INT16 Consistancy(void)
ret -= mo->hprev->state - states;
ret += mo->hprev->tics;
ret -= mo->hprev->sprite;
ret += mo->hprev->frame;
//ret += mo->hprev->frame;
}
else
ret ^= 0xCCCC;
ret -= mo->state - states;
ret += mo->tics;
ret -= mo->sprite;
ret += mo->frame;
//ret += mo->frame;
}
}
}

View file

@ -2624,7 +2624,7 @@ static UINT32 SaveSlope(const pslope_t *slope)
return 0xFFFFFFFF;
}
static boolean TypeIsNetSynced(mobjtype_t type)
boolean TypeIsNetSynced(mobjtype_t type)
{
// Ignore stationary hoops - these will be respawned from mapthings.
if (type == MT_HOOP)

View file

@ -92,6 +92,8 @@ boolean P_SaveBufferFromFile(savebuffer_t *save, char const *name);
void P_SaveBufferFree(savebuffer_t *save);
size_t P_SaveBufferRemaining(const savebuffer_t *save);
boolean TypeIsNetSynced(mobjtype_t type);
#ifdef __cplusplus
} // extern "C"
#endif