- messy pointer use cleaned up.

This commit is contained in:
Christoph Oelckers 2022-08-20 23:49:27 +02:00
parent a630f27a48
commit a93349b445

View file

@ -265,21 +265,17 @@ void MoveSpritesWithSpike(sectortype* sect)
int DoSpike(DSWActor* actor) int DoSpike(DSWActor* actor)
{ {
int *lptr;
// zclip = floor or ceiling z // zclip = floor or ceiling z
// oz = original z // oz = original z
// z_tgt = target z - on pos // z_tgt = target z - on pos
// sz = starting z - off pos // sz = starting z - off pos
lptr = &actor->user.zclip; DoSpikeMove(actor, &actor->user.zclip);
DoSpikeMove(actor, lptr);
MoveSpritesWithSpike(actor->sector()); MoveSpritesWithSpike(actor->sector());
SpikeAlign(actor); SpikeAlign(actor);
// EQUAL this entry has finished // EQUAL this entry has finished
if (*lptr == actor->user.int_z_tgt()) if (actor->user.int_zclip() == actor->user.int_z_tgt())
{ {
// in the ON position // in the ON position
if (actor->user.int_z_tgt() == actor->int_pos().Z) if (actor->user.int_z_tgt() == actor->int_pos().Z)
@ -326,7 +322,7 @@ int DoSpike(DSWActor* actor)
} }
// setup to go back to the original z // setup to go back to the original z
if (*lptr != actor->user.int_oz()) if (actor->user.int_zclip() != actor->user.int_oz())
{ {
if (actor->user.WaitTics) if (actor->user.WaitTics)
actor->user.Tics = actor->user.WaitTics; actor->user.Tics = actor->user.WaitTics;
@ -375,16 +371,12 @@ int DoSpike(DSWActor* actor)
int DoSpikeAuto(DSWActor* actor) int DoSpikeAuto(DSWActor* actor)
{ {
int *lptr; DoSpikeMove(actor, &actor->user.zclip);
lptr = &actor->user.zclip;
DoSpikeMove(actor, lptr);
MoveSpritesWithSpike(actor->sector()); MoveSpritesWithSpike(actor->sector());
SpikeAlign(actor); SpikeAlign(actor);
// EQUAL this entry has finished // EQUAL this entry has finished
if (*lptr == actor->user.int_z_tgt()) if (actor->user.int_zclip() == actor->user.int_z_tgt())
{ {
// in the UP position // in the UP position
if (actor->user.int_z_tgt() == actor->int_pos().Z) if (actor->user.int_z_tgt() == actor->int_pos().Z)