Skip to content

Commit

Permalink
- getanimationgoal.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Nov 21, 2021
1 parent 6a1bc31 commit d03bcf4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions source/games/duke/src/actors.cpp
Expand Up @@ -3503,7 +3503,7 @@ void handle_se08(DDukeActor *actor, bool checkhitag1)
}
j = 1;
}
else j = getanimationgoal(anim_ceilingz, s->sectnum);
else j = getanimationgoal(anim_ceilingz, s->sector());

if (j >= 0)
{
Expand Down Expand Up @@ -3592,7 +3592,7 @@ void handle_se10(DDukeActor* actor, const int* specialtags)
{
if (specialtags) for (int i = 0; specialtags[i]; i++)
{
if (s->sector()->lotag == specialtags[i] && getanimationgoal(anim_ceilingz, s->sectnum) >= 0)
if (s->sector()->lotag == specialtags[i] && getanimationgoal(anim_ceilingz, s->sector()) >= 0)
{
return;
}
Expand Down Expand Up @@ -4342,7 +4342,7 @@ void handle_se22(DDukeActor* actor)
auto sc = actor->getSector();
if (t[1])
{
if (getanimationgoal(anim_ceilingz, t[0]) >= 0)
if (getanimationgoal(anim_ceilingz, &sector[t[0]]) >= 0)
sc->ceilingz += sc->extra * 9;
else t[1] = 0;
}
Expand Down
8 changes: 4 additions & 4 deletions source/games/duke/src/bowling.cpp
Expand Up @@ -59,23 +59,23 @@ void ballreturn(DDukeActor *ball)

void pinsectorresetdown(int sect)
{
int j = getanimationgoal(anim_ceilingz, sect);
auto sec = &sector[sect];
int j = getanimationgoal(anim_ceilingz, sec);

if (j == -1)
{
auto sec = &sector[sect];
j = sec->floorz;
setanimation(sec, anim_ceilingz, sec, j, 64);
}
}

int pinsectorresetup(int sect)
{
int j = getanimationgoal(anim_ceilingz, sect);
auto sec = &sector[sect];
int j = getanimationgoal(anim_ceilingz, sec);

if (j == -1)
{
auto sec = &sector[sect];
j = nextsectorneighborzptr(sec, sec->ceilingz, -1, -1)->ceilingz;
setanimation(sec, anim_ceilingz, sec, j, 64);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/funct.h
Expand Up @@ -150,7 +150,7 @@ void operateforcefields_common(DDukeActor* s, int low, const std::initializer_li
void operatemasterswitches(int lotag);
void operatesectors(sectortype* s, DDukeActor* i);
void hud_input(int playerNum);
int getanimationgoal(int animtype, int animindex);
int getanimationgoal(int animtype, sectortype* animindex);
bool isanearoperator(int lotag);
bool isanunderoperator(int lotag);
int setanimation(sectortype* animsect, int animtype, walltype* animtarget, int thegoal, int thevel);
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/player_r.cpp
Expand Up @@ -3569,7 +3569,7 @@ void processinput_r(int snum)
if (psectlotag == ST_17_PLATFORM_UP || (isRRRA() && psectlotag == ST_18_ELEVATOR_DOWN))
{
int tmp;
tmp = getanimationgoal(anim_floorz, p->cursectnum);
tmp = getanimationgoal(anim_floorz, p->cursector());
if (tmp >= 0)
{
if (!S_CheckActorSoundPlaying(pact, 432))
Expand Down
11 changes: 6 additions & 5 deletions source/games/duke/src/sectors.cpp
Expand Up @@ -375,11 +375,12 @@ void doanimations(void)
//
//---------------------------------------------------------------------------

int getanimationgoal(int animtype, int animtarget)
int getanimationgoal(int animtype, sectortype* animtargetp)
{
int i, j;

j = -1;
int animtarget = sectnum(animtargetp);
for (i = animatecnt - 1; i >= 0; i--)
if (animtype == animatetype[i] && animtarget == animatetarget[i])
{
Expand Down Expand Up @@ -620,7 +621,7 @@ static void handle_st15(sectortype* sptr, DDukeActor* actor)

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

if (i == -1)
Expand Down Expand Up @@ -648,7 +649,7 @@ static void handle_st16(sectortype* sptr, DDukeActor* actor)

static void handle_st18(sectortype* sptr, DDukeActor* actor)
{
int i = getanimationgoal(anim_floorz, sectnum(sptr));
int i = getanimationgoal(anim_floorz, sptr);

if (i == -1)
{
Expand Down Expand Up @@ -751,7 +752,7 @@ static void handle_st20(sectortype* sptr, DDukeActor* actor)

static void handle_st21(sectortype* sptr, DDukeActor* actor)
{
int i = getanimationgoal(anim_floorz, sectnum(sptr));
int i = getanimationgoal(anim_floorz, sptr);
int j;
if (i >= 0)
{
Expand Down Expand Up @@ -998,7 +999,7 @@ void operatesectors(sectortype* sptr, DDukeActor *actor)
break;
}
case ST_26_SPLITTING_ST_DOOR: //The split doors
i = getanimationgoal(anim_ceilingz, sectnum(sptr));
i = getanimationgoal(anim_ceilingz, sptr);
if (i == -1) //if the door has stopped
{
haltsoundhack = 1;
Expand Down

0 comments on commit d03bcf4

Please sign in to comment.