- pass a sector pointer to checkcursectnums.

This commit is contained in:
Christoph Oelckers 2021-11-18 21:02:59 +01:00
parent 3ce2375a3e
commit 69c21407a7
4 changed files with 8 additions and 8 deletions

View file

@ -718,7 +718,7 @@ void movecrane(DDukeActor *actor, int crane)
spri->picnum++; spri->picnum++;
if (spri->picnum == (crane + 2)) if (spri->picnum == (crane + 2))
{ {
int p = checkcursectnums(t[1]); int p = checkcursectnums(&sector[t[1]]);
if (p >= 0 && ps[p].on_ground) if (p >= 0 && ps[p].on_ground)
{ {
actor->SetActiveCrane(true); actor->SetActiveCrane(true);
@ -1126,7 +1126,7 @@ void movetouchplate(DDukeActor* actor, int plate)
else else
{ {
sectp->floorz += sectp->extra; sectp->floorz += sectp->extra;
p = checkcursectnums(s->sectnum); p = checkcursectnums(s->sector());
if (p >= 0) ps[p].pos.z += sectp->extra; if (p >= 0) ps[p].pos.z += sectp->extra;
} }
} }
@ -1140,7 +1140,7 @@ void movetouchplate(DDukeActor* actor, int plate)
else else
{ {
sectp->floorz -= sectp->extra; sectp->floorz -= sectp->extra;
p = checkcursectnums(s->sectnum); p = checkcursectnums(s->sector());
if (p >= 0) if (p >= 0)
ps[p].pos.z -= sectp->extra; ps[p].pos.z -= sectp->extra;
} }
@ -1150,7 +1150,7 @@ void movetouchplate(DDukeActor* actor, int plate)
if (t[5] == 1) return; if (t[5] == 1) return;
p = checkcursectnums(s->sectnum); p = checkcursectnums(s->sector());
if (p >= 0 && (ps[p].on_ground || s->ang == 512)) if (p >= 0 && (ps[p].on_ground || s->ang == 512))
{ {
if (t[0] == 0 && !check_activator_motion(s->lotag)) if (t[0] == 0 && !check_activator_motion(s->lotag))

View file

@ -2239,7 +2239,7 @@ void movetransports_d(void)
case 0: case 0:
if (onfloorz) if (onfloorz)
{ {
if (spr2->statnum == STAT_PROJECTILE || (checkcursectnums(spr->sectnum) == -1 && checkcursectnums(Owner->s->sectnum) == -1)) if (spr2->statnum == STAT_PROJECTILE || (checkcursectnums(spr->sector()) == -1 && checkcursectnums(Owner->s->sector()) == -1))
{ {
spr2->x += (Owner->s->x - spr->x); spr2->x += (Owner->s->x - spr->x);
spr2->y += (Owner->s->y - spr->y); spr2->y += (Owner->s->y - spr->y);

View file

@ -1842,7 +1842,7 @@ void movetransports_r(void)
case ST_0_NO_EFFECT: case ST_0_NO_EFFECT:
if (onfloorz) if (onfloorz)
{ {
if (checkcursectnums(spr->sectnum) == -1 && checkcursectnums(Owner->s->sectnum) == -1) if (checkcursectnums(spr->sector()) == -1 && checkcursectnums(Owner->s->sector()) == -1)
{ {
spr2->x += (Owner->s->x - spr->x); spr2->x += (Owner->s->x - spr->x);
spr2->y += (Owner->s->y - spr->y); spr2->y += (Owner->s->y - spr->y);

View file

@ -73,11 +73,11 @@ inline bool wallswitchcheck(DDukeActor* s)
return !!(gs.tileinfo[s->s->picnum].flags & TFLAG_WALLSWITCH); return !!(gs.tileinfo[s->s->picnum].flags & TFLAG_WALLSWITCH);
} }
inline int checkcursectnums(int se) inline int checkcursectnums(sectortype* se)
{ {
int i; int i;
for(i=connecthead;i>=0;i=connectpoint2[i]) for(i=connecthead;i>=0;i=connectpoint2[i])
if(ps[i].GetActor() && ps[i].GetActor()->s->sectnum == se ) return i; if(ps[i].GetActor() && ps[i].GetActor()->s->sector() == se ) return i;
return -1; return -1;
} }