- iterate linearly over sector effectors.

Apparently they aren't all properly linked into the required statnums.
Fixes #179
This commit is contained in:
Christoph Oelckers 2020-11-12 19:12:30 +01:00
parent 50beb113ff
commit f9a776e71c
3 changed files with 8 additions and 7 deletions

View file

@ -119,7 +119,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
if (isRRRA() && ((sector[hitsect].lotag == 160 && zvel > 0) || (sector[hitsect].lotag == 161 && zvel < 0))
&& hitsprt == nullptr && hitwall == -1)
{
DukeSpriteIterator its;
DukeLinearSpriteIterator its;
while (auto effector = its.Next())
{
// shouldn't this only check STAT_EFFECTOR?
@ -276,7 +276,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
if (isRRRA() && (((sector[hitsect].lotag == 160 && zvel > 0) || (sector[hitsect].lotag == 161 && zvel < 0))
&& hitsprt == nullptr && hitwall == -1))
{
DukeSpriteIterator its;
DukeLinearSpriteIterator its;
while (auto effector = its.Next())
{
// shouldn't this only check STAT_EFFECTOR?

View file

@ -786,7 +786,7 @@ bool checkhitswitch_r(int snum, int ww, DDukeActor* act)
DDukeActor* switches[3];
int switchcount = 0, j;
S_PlaySound3D(SWITCH_ON, act, &v);
DukeSpriteIterator it;
DukeLinearSpriteIterator it;
while (auto actt = it.Next())
{
int jpn = actt->s.picnum;

View file

@ -640,12 +640,13 @@ void spawneffector(DDukeActor* actor)
break;
case SE_7_TELEPORT: // Transporters!!!!
case SE_23_ONE_WAY_TELEPORT:// XPTR END
if (sp->lotag != 23)
if (sp->lotag != SE_23_ONE_WAY_TELEPORT)
{
DukeSpriteIterator it;
DukeLinearSpriteIterator it;
while (auto act2 = it.Next())
{
if (act2->s.statnum < MAXSTATUS && act2->s.picnum == SECTOREFFECTOR && (act2->s.lotag == 7 || act2->s.lotag == 23) && actor != act2 && act2->s.hitag == sp->hitag)
if (act2->s.statnum < MAXSTATUS && act2->s.picnum == SECTOREFFECTOR && (act2->s.lotag == SE_7_TELEPORT || act2->s.lotag == SE_23_ONE_WAY_TELEPORT) &&
actor != act2 && act2->s.hitag == sp->hitag)
{
actor->SetOwner(act2);
break;
@ -964,7 +965,7 @@ void spawneffector(DDukeActor* actor)
sector[sect].hitag = ActorToScriptIndex(actor);
}
DukeSpriteIterator it;
DukeLinearSpriteIterator it;
bool found = false;
while (auto act2 = it.Next())
{