- handle_SE14 function signature and recordoldspritepos

This commit is contained in:
Christoph Oelckers 2020-10-21 23:56:46 +02:00
parent d2b4cf6770
commit 2dd2ba1469
4 changed files with 9 additions and 13 deletions

View file

@ -2792,9 +2792,8 @@ void handle_se01(DDukeActor *actor)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void handle_se14(int i, bool checkstat, int RPG, int JIBS6) void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
{ {
auto actor = &hittype[i];
auto s = &actor->s; auto s = &actor->s;
int* t = &actor->temp_data[0]; int* t = &actor->temp_data[0];
auto sc = &sector[s->sectnum]; auto sc = &sector[s->sectnum];
@ -5138,15 +5137,12 @@ void recordoldspritepos()
{ {
for (int statNum = 0; statNum < MAXSTATUS; statNum++) for (int statNum = 0; statNum < MAXSTATUS; statNum++)
{ {
StatIterator it(statNum); DukeStatIterator it(statNum);
int j; while (auto ac = it.Next())
while ((j = it.NextIndex()) >= 0)
{ {
auto s = &sprite[j]; ac->bposx = ac->s.x;
auto h = &hittype[j]; ac->bposy = ac->s.y;
h->bposx = s->x; ac->bposz = ac->s.z;
h->bposy = s->y;
h->bposz = s->z;
} }
} }
} }

View file

@ -3624,7 +3624,7 @@ void moveeffectors_d(void) //STATNUM 3
x = 0; x = 0;
} }
case SE_14_SUBWAY_CAR: case SE_14_SUBWAY_CAR:
handle_se14(i, true, RPG, JIBS6); handle_se14(&hittype[i], true, RPG, JIBS6);
break; break;
case SE_30_TWO_WAY_TRAIN: case SE_30_TWO_WAY_TRAIN:

View file

@ -3585,7 +3585,7 @@ void moveeffectors_r(void) //STATNUM 3
} }
case SE_14_SUBWAY_CAR: case SE_14_SUBWAY_CAR:
handle_se14(i, false, RPG, JIBS6); handle_se14(&hittype[i], false, RPG, JIBS6);
break; break;
case SE_30_TWO_WAY_TRAIN: case SE_30_TWO_WAY_TRAIN:

View file

@ -65,7 +65,7 @@ void scrap(DDukeActor* i, int SCRAP1, int SCRAP6);
void handle_se00(DDukeActor* i, int LASERLINE); void handle_se00(DDukeActor* i, int LASERLINE);
void handle_se01(DDukeActor* i); void handle_se01(DDukeActor* i);
void handle_se14(int i, bool checkstat, int RPG, int JIBS6); void handle_se14(DDukeActor* i, bool checkstat, int RPG, int JIBS6);
void handle_se30(int i, int JIBS6); void handle_se30(int i, int JIBS6);
void handle_se02(int i); void handle_se02(int i);
void handle_se03(int i); void handle_se03(int i);