diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index ef8c2fbab..c2b42b5cd 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -718,7 +718,7 @@ void movecrane(DDukeActor *actor, int crane) spri->picnum++; if (spri->picnum == (crane + 2)) { - int p = checkcursectnums(t[1]); + int p = checkcursectnums(§or[t[1]]); if (p >= 0 && ps[p].on_ground) { actor->SetActiveCrane(true); @@ -1126,7 +1126,7 @@ void movetouchplate(DDukeActor* actor, int plate) else { sectp->floorz += sectp->extra; - p = checkcursectnums(s->sectnum); + p = checkcursectnums(s->sector()); if (p >= 0) ps[p].pos.z += sectp->extra; } } @@ -1140,7 +1140,7 @@ void movetouchplate(DDukeActor* actor, int plate) else { sectp->floorz -= sectp->extra; - p = checkcursectnums(s->sectnum); + p = checkcursectnums(s->sector()); if (p >= 0) ps[p].pos.z -= sectp->extra; } @@ -1150,7 +1150,7 @@ void movetouchplate(DDukeActor* actor, int plate) if (t[5] == 1) return; - p = checkcursectnums(s->sectnum); + p = checkcursectnums(s->sector()); if (p >= 0 && (ps[p].on_ground || s->ang == 512)) { if (t[0] == 0 && !check_activator_motion(s->lotag)) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index e41d4cc27..5122bf1ae 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2239,7 +2239,7 @@ void movetransports_d(void) case 0: 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->y += (Owner->s->y - spr->y); diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index a4d0148e9..a6c128f0e 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1842,7 +1842,7 @@ void movetransports_r(void) case ST_0_NO_EFFECT: 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->y += (Owner->s->y - spr->y); diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index bb1836504..ab0b64579 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -73,11 +73,11 @@ inline bool wallswitchcheck(DDukeActor* s) return !!(gs.tileinfo[s->s->picnum].flags & TFLAG_WALLSWITCH); } -inline int checkcursectnums(int se) +inline int checkcursectnums(sectortype* se) { int 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; }