diff --git a/source/games/duke/src/dukeactor.h b/source/games/duke/src/dukeactor.h index e07c711f9..a7003e084 100644 --- a/source/games/duke/src/dukeactor.h +++ b/source/games/duke/src/dukeactor.h @@ -227,9 +227,4 @@ inline void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16 *neartagsprite = nts == -1 ? nullptr : &hittype[nts]; } -inline void lotsofglass(DDukeActor *act, int wallnum, int cnt) -{ - lotsofglass(act ? act->GetIndex() : -1, wallnum, cnt); -} - END_DUKE_NS diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 14fa7a539..d679ac189 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -179,7 +179,7 @@ DDukeActor* EGS(short whatsect, int s_x, int s_y, int s_z, short s_pn, signed ch void ceilingglass(DDukeActor* snum, int sectnum, int cnt); void spriteglass(DDukeActor* snum, int cnt); void lotsofcolourglass(DDukeActor* snum, int wallNum, int cnt); -void lotsofglass(int snum, int wallnum, int cnt); +void lotsofglass(DDukeActor* snum, int wallnum, int cnt); void checkplayerhurt_d(struct player_struct* p, const Collision& coll); void checkplayerhurt_r(struct player_struct* p, const Collision& coll); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index da8f4d2c3..a29fadc79 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -530,7 +530,7 @@ void initcrane(DDukeActor* actj, DDukeActor* acti, int CRANEPOLE) } tempwallptr += 3; - sp->owner = -1; + acti->SetOwner(nullptr); sp->extra = 8; changespritestat(acti, STAT_STANDABLE); } @@ -1107,11 +1107,11 @@ void spawneffector(DDukeActor* actor) // //--------------------------------------------------------------------------- -void lotsofglass(int i, int wallnum, int n) +void lotsofglass(DDukeActor *actor, int wallnum, int n) { int j, xv, yv, z, x1, y1, a; short sect; - auto sp = &sprite[i]; + auto sp = &actor->s; sect = -1; @@ -1151,7 +1151,7 @@ void lotsofglass(int i, int wallnum, int n) if (z < -(32 << 8) || z >(32 << 8)) z = sp->z - (32 << 8) + (krand() & ((64 << 8) - 1)); a = sp->ang - 1024; - EGS(sp->sectnum, x1, y1, z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 1023), &hittype[i], 5); + EGS(sp->sectnum, x1, y1, z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 1023), actor, 5); } } }