Skip to content

Commit

Permalink
- handle_st15 / handle_st16.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Nov 21, 2021
1 parent e738b03 commit 3547c74
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions source/games/duke/src/sectors.cpp
Expand Up @@ -594,20 +594,19 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
//
//---------------------------------------------------------------------------

static void handle_st15(int sn, DDukeActor* actor)
static void handle_st15(sectortype* sptr, DDukeActor* actor)
{
if (actor->s->picnum != TILE_APLAYER) return;

sectortype* sptr = &sector[sn];
DukeSectIterator it(sn);
DukeSectIterator it(sptr);
DDukeActor* a2;
while ((a2 = it.Next()))
{
if (a2->s->picnum == SECTOREFFECTOR && a2->s->lotag == ST_17_PLATFORM_UP) break;
}
if (!a2) return;

if (actor->s->sectnum == sn)
if (actor->s->sector() == sptr)
{
if (activatewarpelevators(a2, -1))
activatewarpelevators(a2, 1);
Expand All @@ -630,10 +629,9 @@ static void handle_st15(int sn, DDukeActor* actor)
//
//---------------------------------------------------------------------------

static void handle_st16(int sn, DDukeActor* actor)
static void handle_st16(sectortype* sptr, DDukeActor* actor)
{
sectortype* sptr = &sector[sn];
int i = getanimationgoal(anim_floorz, sn);
int i = getanimationgoal(anim_floorz, sectnum(sptr));
sectortype* sectp;

if (i == -1)
Expand All @@ -643,13 +641,13 @@ static void handle_st16(int sn, DDukeActor* actor)
{
sectp = nextsectorneighborzptr(sptr, sptr->floorz, 1, -1);
if (sectp == nullptr) return;
setanimation(sn, anim_floorz, sn, sectp->floorz, sptr->extra);
setanimation(sptr, anim_floorz, sptr, sectp->floorz, sptr->extra);
}
else
{
setanimation(sn, anim_floorz, sn, sectp->floorz, sptr->extra);
setanimation(sptr, anim_floorz, sptr, sectp->floorz, sptr->extra);
}
callsound(sn, actor);
callsound(sptr, actor);
}
}

Expand Down Expand Up @@ -1039,12 +1037,12 @@ void operatesectors(int sn, DDukeActor *actor)
return;

case ST_15_WARP_ELEVATOR://Warping elevators
handle_st15(sn, actor);
handle_st15(sptr, actor);
return;

case ST_16_PLATFORM_DOWN:
case ST_17_PLATFORM_UP:
handle_st16(sn, actor);
handle_st16(sptr, actor);
return;

case ST_18_ELEVATOR_DOWN:
Expand Down

0 comments on commit 3547c74

Please sign in to comment.