- activatebysector.

This commit is contained in:
Christoph Oelckers 2020-11-02 19:28:59 +01:00
parent 7aca51a6c4
commit 7c6ea9cff7
8 changed files with 21 additions and 24 deletions

View file

@ -3636,7 +3636,7 @@ void handle_se10(DDukeActor* actor, const int* specialtags)
return;
}
}
fi.activatebysector(s->sectnum, actor->GetIndex());
fi.activatebysector(s->sectnum, actor);
t[0] = 0;
}
else t[0]++;

View file

@ -45,8 +45,8 @@ void operateforcefields_r(int s, int low);
void operateforcefields_d(int s, int low);
bool checkhitswitch_d(int snum, int w, DDukeActor *act);
bool checkhitswitch_r(int snum, int w, DDukeActor* act);
void activatebysector_d(int sect, int j);
void activatebysector_r(int sect, int j);
void activatebysector_d(int sect, DDukeActor* j);
void activatebysector_r(int sect, DDukeActor* j);
void checkhitwall_d(DDukeActor* spr, int dawallnum, int x, int y, int z, int atwith);
void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atwith);
bool checkhitceiling_d(int sn);

View file

@ -77,7 +77,7 @@ struct Dispatcher
void (*operaterespawns)(int low);
void (*operateforcefields)(int s, int low);
bool (*checkhitswitch)(int snum, int w, DDukeActor* act);
void (*activatebysector)(int sect, int j);
void (*activatebysector)(int sect, DDukeActor* j);
void (*checkhitwall)(DDukeActor* spr, int dawallnum, int x, int y, int z, int atwith);
bool (*checkhitceiling)(int sn);
void (*checkhitsprite)(DDukeActor* i, DDukeActor* sn);

View file

@ -3093,7 +3093,7 @@ HORIZONLY:
{
if (!(sector[s->sectnum].lotag & 0x8000) && (isanunderoperator(sector[s->sectnum].lotag) ||
isanearoperator(sector[s->sectnum].lotag)))
fi.activatebysector(s->sectnum, pi);
fi.activatebysector(s->sectnum, pact);
if (j)
{
quickkill(p);
@ -3101,7 +3101,7 @@ HORIZONLY:
}
}
else if (abs(fz - cz) < (32 << 8) && isanunderoperator(sector[psect].lotag))
fi.activatebysector(psect, pi);
fi.activatebysector(psect, pact);
}
// center_view

View file

@ -4063,7 +4063,7 @@ HORIZONLY:
{
if (!(sector[s->sectnum].lotag & 0x8000) && (isanunderoperator(sector[s->sectnum].lotag) ||
isanearoperator(sector[s->sectnum].lotag)))
fi.activatebysector(s->sectnum, pact->GetIndex());
fi.activatebysector(s->sectnum, pact);
if (j)
{
quickkill(p);
@ -4071,7 +4071,7 @@ HORIZONLY:
}
}
else if (abs(fz - cz) < (32 << 8) && isanunderoperator(sector[psect].lotag))
fi.activatebysector(psect, pact->GetIndex());
fi.activatebysector(psect, pact);
}
if (ud.clipping == 0 && sector[p->cursectnum].ceilingz > (sector[p->cursectnum].floorz - (12 << 8)))

View file

@ -404,7 +404,6 @@ void setdrugmode(player_struct *p, int oyrepeat)
static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixedhoriz choriz, int sect, int smoothratio)
{
short gs, tgsect, geosect, geoid = 0;
int spr;
renderDrawRoomsQ16(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), sect);
fi.animatesprites(cposx, cposy, cang.asbuild(), smoothratio);
renderDrawMasks();

View file

@ -613,25 +613,25 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act)
//
//---------------------------------------------------------------------------
void activatebysector_d(int sect, int j)
void activatebysector_d(int sect, DDukeActor* activator)
{
short i, didit;
short didit;
didit = 0;
SectIterator it(sect);
while ((i = it.NextIndex()) >= 0)
DukeSectIterator it(sect);
while (auto act = it.Next())
{
if (sprite[i].picnum == ACTIVATOR)
if (act->s.picnum == ACTIVATOR)
{
operateactivators(sprite[i].lotag, -1);
operateactivators(act->s.lotag, -1);
didit = 1;
// return;
}
}
if (didit == 0)
operatesectors(sect, &hittype[j]);
operatesectors(sect, activator);
}
//---------------------------------------------------------------------------

View file

@ -895,22 +895,20 @@ bool checkhitswitch_r(int snum, int ww, DDukeActor* act)
//
//---------------------------------------------------------------------------
void activatebysector_r(int sect, int j)
void activatebysector_r(int sect, DDukeActor* activator)
{
short i;
SectIterator it(sect);
while ((i = it.NextIndex()) >= 0)
DukeSectIterator it(sect);
while (auto act = it.Next())
{
if (sprite[i].picnum == ACTIVATOR)
if (act->s.picnum == ACTIVATOR)
{
operateactivators(sprite[i].lotag, -1);
operateactivators(act->s.lotag, -1);
// return;
}
}
if (sector[sect].lotag != 22)
operatesectors(sect, &hittype[j]);
operatesectors(sect, activator);
}