From a93349b4452ad2c0494b2221520b0182dd0a04cf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2022 23:49:27 +0200 Subject: [PATCH] - messy pointer use cleaned up. --- source/games/sw/src/spike.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/source/games/sw/src/spike.cpp b/source/games/sw/src/spike.cpp index c8410a339..b1e40ab99 100644 --- a/source/games/sw/src/spike.cpp +++ b/source/games/sw/src/spike.cpp @@ -265,21 +265,17 @@ void MoveSpritesWithSpike(sectortype* sect) int DoSpike(DSWActor* actor) { - int *lptr; - // zclip = floor or ceiling z // oz = original z // z_tgt = target z - on pos // sz = starting z - off pos - lptr = &actor->user.zclip; - - DoSpikeMove(actor, lptr); + DoSpikeMove(actor, &actor->user.zclip); MoveSpritesWithSpike(actor->sector()); SpikeAlign(actor); // 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 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 - if (*lptr != actor->user.int_oz()) + if (actor->user.int_zclip() != actor->user.int_oz()) { if (actor->user.WaitTics) actor->user.Tics = actor->user.WaitTics; @@ -375,16 +371,12 @@ int DoSpike(DSWActor* actor) int DoSpikeAuto(DSWActor* actor) { - int *lptr; - - lptr = &actor->user.zclip; - - DoSpikeMove(actor, lptr); + DoSpikeMove(actor, &actor->user.zclip); MoveSpritesWithSpike(actor->sector()); SpikeAlign(actor); // 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 if (actor->user.int_z_tgt() == actor->int_pos().Z)