- handle_st15.

This commit is contained in:
Christoph Oelckers 2020-10-23 19:08:11 +02:00
parent c9c649d3f8
commit 7c491742f9

View file

@ -574,30 +574,31 @@ static void handle_st09(int sn, DDukeActor* actor)
static void handle_st15(int sn, DDukeActor* actor) static void handle_st15(int sn, DDukeActor* actor)
{ {
if (actor->s.picnum != TILE_APLAYER) return; if (actor->s.picnum != TILE_APLAYER) return;
int i;
// if(ps[sprite[ii].yvel].select_dir == 1) return; // if(ps[sprite[ii].yvel].select_dir == 1) return;
sectortype* sptr = &sector[sn]; sectortype* sptr = &sector[sn];
SectIterator it(sn); DukeSectIterator it(sn);
while ((i = it.NextIndex()) >= 0) DDukeActor* a2;
while ((a2 = it.Next()))
{ {
if (sprite[i].picnum == SECTOREFFECTOR && sprite[i].lotag == 17) break; if (a2->s.picnum == SECTOREFFECTOR && a2->s.lotag == ST_17_PLATFORM_UP) break;
} }
if (!a2) return;
if (actor->s.sectnum == sn) if (actor->s.sectnum == sn)
{ {
if (activatewarpelevators(&hittype[i], -1)) if (activatewarpelevators(a2, -1))
activatewarpelevators(&hittype[i], 1); activatewarpelevators(a2, 1);
else if (activatewarpelevators(&hittype[i], 1)) else if (activatewarpelevators(a2, 1))
activatewarpelevators(&hittype[i], -1); activatewarpelevators(a2, -1);
return; return;
} }
else else
{ {
if (sptr->floorz > sprite[i].z) if (sptr->floorz > a2->s.z)
activatewarpelevators(&hittype[i], -1); activatewarpelevators(a2, -1);
else else
activatewarpelevators(&hittype[i], 1); activatewarpelevators(a2, 1);
} }
} }