- wrap actor index storage in sector in the script index API.

This commit is contained in:
Christoph Oelckers 2020-11-04 19:04:20 +01:00
parent 471a25f819
commit 7a95c1661e
2 changed files with 4 additions and 3 deletions

View file

@ -4030,7 +4030,8 @@ HORIZONLY:
psect = s->sectnum;
if (ud.clipping == 0 && sector[psect].lotag == ST_31_TWO_WAY_TRAIN)
{
if (sprite[sector[psect].hitag].xvel && hittype[sector[psect].hitag].temp_data[0] == 0) // hijack
auto act = ScriptIndexToActor(sector[psect].hitag);
if (act && act->s.xvel && act->temp_data[0] == 0)
{
quickkill(p);
return;

View file

@ -961,7 +961,7 @@ void spawneffector(DDukeActor* actor)
if (sp->pal) sp->clipdist = 1;
else sp->clipdist = 0;
t[3] = sector[sect].floorz;
sector[sect].hitag = actor->GetIndex(); // hijack
sector[sect].hitag = ActorToScriptIndex(actor);
}
DukeSpriteIterator it;
@ -1014,7 +1014,7 @@ void spawneffector(DDukeActor* actor)
sp->extra = 0;
else sp->extra = 1;
sector[sect].hitag = actor->GetIndex(); // hijack
sector[sect].hitag = ActorToScriptIndex(actor);
int j = 0;