mirror of
https://github.com/DrBeef/Raze.git
synced 2025-04-01 21:50:51 +00:00
- wrapped user.oz reads.
This commit is contained in:
parent
306e751a51
commit
a7d62f944b
4 changed files with 17 additions and 16 deletions
|
@ -930,6 +930,7 @@ struct USER
|
|||
memset(&WallP, 0, sizeof(USER) - myoffsetof(USER, WallP));
|
||||
}
|
||||
|
||||
int int_oz() const { return oz; }
|
||||
int int_loz() const { return loz * zworldtoint; }
|
||||
int int_hiz() const { return hiz * zworldtoint; }
|
||||
|
||||
|
|
|
@ -49,18 +49,18 @@ void ReverseSpike(DSWActor* actor)
|
|||
}
|
||||
|
||||
// moving toward to OFF pos
|
||||
if (actor->user.z_tgt == actor->user.oz)
|
||||
if (actor->user.z_tgt == actor->user.int_oz())
|
||||
{
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
if (actor->int_pos().Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
else if (actor->user.pos.Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
}
|
||||
else if (actor->user.z_tgt == actor->user.pos.Z)
|
||||
{
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
if (actor->int_pos().Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
else if (actor->user.pos.Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ int DoSpike(DSWActor* actor)
|
|||
}
|
||||
|
||||
// setup to go back to the original z
|
||||
if (*lptr != actor->user.oz)
|
||||
if (*lptr != actor->user.int_oz())
|
||||
{
|
||||
if (actor->user.WaitTics)
|
||||
actor->user.Tics = actor->user.WaitTics;
|
||||
|
@ -335,7 +335,7 @@ int DoSpike(DSWActor* actor)
|
|||
else // if (*lptr == actor->user.z_tgt)
|
||||
{
|
||||
// if heading for the OFF (original) position and should NOT CRUSH
|
||||
if (TEST_BOOL3(actor) && actor->user.z_tgt == actor->user.oz)
|
||||
if (TEST_BOOL3(actor) && actor->user.z_tgt == actor->user.int_oz())
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
|
|
|
@ -2262,7 +2262,7 @@ void SpriteSetup(void)
|
|||
|
||||
// set orig z
|
||||
actor->user.oz = actor->user.zclip;
|
||||
actor->opos.Z = actor->user.oz * zinttoworld;
|
||||
actor->opos.Z = actor->user.int_oz() * zinttoworld;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2281,7 +2281,7 @@ void SpriteSetup(void)
|
|||
|
||||
// set orig z
|
||||
actor->user.oz = actor->user.zclip;
|
||||
actor->opos.Z = actor->user.oz * zinttoworld;
|
||||
actor->opos.Z = actor->user.int_oz() * zinttoworld;
|
||||
}
|
||||
|
||||
change_actor_stat(actor, STAT_SPIKE);
|
||||
|
|
|
@ -54,18 +54,18 @@ void ReverseVator(DSWActor* actor)
|
|||
}
|
||||
|
||||
// moving toward to OFF pos
|
||||
if (actor->user.z_tgt == actor->user.oz)
|
||||
if (actor->user.z_tgt == actor->user.int_oz())
|
||||
{
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
if (actor->int_pos().Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
else if (actor->user.pos.Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
}
|
||||
else if (actor->user.z_tgt == actor->user.pos.Z)
|
||||
{
|
||||
if (actor->int_pos().Z == actor->user.oz)
|
||||
if (actor->int_pos().Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->int_pos().Z;
|
||||
else if (actor->user.pos.Z == actor->user.oz)
|
||||
else if (actor->user.pos.Z == actor->user.int_oz())
|
||||
actor->user.z_tgt = actor->user.pos.Z;
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ int DoVator(DSWActor* actor)
|
|||
}
|
||||
|
||||
// setup to go back to the original z
|
||||
if (zval != actor->user.oz)
|
||||
if (zval != actor->user.int_oz())
|
||||
{
|
||||
if (actor->user.WaitTics)
|
||||
actor->user.Tics = actor->user.WaitTics;
|
||||
|
@ -447,7 +447,7 @@ int DoVator(DSWActor* actor)
|
|||
else // if (*lptr == actor->user.z_tgt)
|
||||
{
|
||||
// if heading for the OFF (original) position and should NOT CRUSH
|
||||
if (TEST_BOOL3(actor) && actor->user.z_tgt == actor->user.oz)
|
||||
if (TEST_BOOL3(actor) && actor->user.z_tgt == actor->user.int_oz())
|
||||
{
|
||||
int i;
|
||||
bool found = false;
|
||||
|
|
Loading…
Reference in a new issue