diff --git a/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs b/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs index b8ea4d7e0..caa6e91ea 100644 --- a/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs +++ b/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs @@ -12,7 +12,7 @@ class DukeBloodSplat1 : DukeActor self.scale.X = 0.109375 + random(0, 7) * REPEAT_SCALE; self.scale.Y = 0.109375 + random(0, 7) * REPEAT_SCALE; self.pos.Z -= 16; - if (self.ownerActor && self.ownerActor.pal == 6) + if (!self.mapSpawned && self.ownerActor && self.ownerActor.pal == 6) self.pal = 6; self.insertspriteq(); } diff --git a/wadsrc/static/zscript/games/duke/actors/canwithsomething.zs b/wadsrc/static/zscript/games/duke/actors/canwithsomething.zs index 6fbf3c195..17ea473be 100644 --- a/wadsrc/static/zscript/games/duke/actors/canwithsomething.zs +++ b/wadsrc/static/zscript/games/duke/actors/canwithsomething.zs @@ -11,7 +11,7 @@ class DukeCanWithSomething : DukeActor override void Initialize() { - if (self.ownerActor != self) + if (!self.mapSpawned) self.scale = (0.5, 0.5); self.makeitfall(); self.cstat = CSTAT_SPRITE_BLOCK_ALL | randomXFlip(); diff --git a/wadsrc/static/zscript/games/duke/actors/dukemisc.zs b/wadsrc/static/zscript/games/duke/actors/dukemisc.zs index f4f6907a6..d7c5b0ebd 100644 --- a/wadsrc/static/zscript/games/duke/actors/dukemisc.zs +++ b/wadsrc/static/zscript/games/duke/actors/dukemisc.zs @@ -74,7 +74,7 @@ class DukeFootprints : DukeActor override void Initialize() { - if (self != self.ownerActor) + if (!self.mapSpawned) { bool away = self.isAwayFromWall(5.25); if (!away) diff --git a/wadsrc/static/zscript/games/duke/actors/forcesphere.zs b/wadsrc/static/zscript/games/duke/actors/forcesphere.zs index 9e2225130..7a7cc0944 100644 --- a/wadsrc/static/zscript/games/duke/actors/forcesphere.zs +++ b/wadsrc/static/zscript/games/duke/actors/forcesphere.zs @@ -8,7 +8,7 @@ class DukeForceSphere : DukeActor override void Initialize() { - if (ownerActor == self) + if (self.mapSpawned) { self.cstat = CSTAT_SPRITE_INVISIBLE; self.ChangeStat(STAT_ZOMBIEACTOR); diff --git a/wadsrc/static/zscript/games/duke/actors/frameeffect.zs b/wadsrc/static/zscript/games/duke/actors/frameeffect.zs index 52a7ec04e..82c526eec 100644 --- a/wadsrc/static/zscript/games/duke/actors/frameeffect.zs +++ b/wadsrc/static/zscript/games/duke/actors/frameeffect.zs @@ -9,7 +9,7 @@ class DukeFrameEffect : DukeActor override void Initialize() { - if (self != self.ownerActor) + if (!self.mapSpawned && self.ownerActor) { self.scale = self.ownerActor.scale; } @@ -41,7 +41,7 @@ class DukeFrameEffect : DukeActor override bool animate(tspritetype t) { let OwnerAc = self.ownerActor; - if (OwnerAc && OwnerAc.statnum < MAXSTATUS) + if (OwnerAc) { if (OwnerAc.isPlayer()) if (ud.cameraactor == nullptr) diff --git a/wadsrc/static/zscript/games/duke/actors/heavyhbomb.zs b/wadsrc/static/zscript/games/duke/actors/heavyhbomb.zs index ec57899c0..7abc4d003 100644 --- a/wadsrc/static/zscript/games/duke/actors/heavyhbomb.zs +++ b/wadsrc/static/zscript/games/duke/actors/heavyhbomb.zs @@ -11,7 +11,7 @@ class DukePipeBomb : DukeActor override void Initialize() { // This is only for placed items, not for armed weapons! - if (self.ownerActor == self) + if (self.mapSpawned) { self.extra = gs.impact_damage; self.cstat |= CSTAT_SPRITE_BLOCK_ALL; // Make it hitable @@ -197,9 +197,9 @@ class DukePipeBomb : DukeActor p.pals = Color(32, 0, 32, 0); } - if (Owner != self || ud.respawn_items == 0) + if (!self.mapSpawned || ud.respawn_items == 0) { - if (Owner == self && ud.coop >= 1) + if (self.mapSpawned && ud.coop >= 1) return false; self.Destroy(); diff --git a/wadsrc/static/zscript/games/duke/actors/mortar.zs b/wadsrc/static/zscript/games/duke/actors/mortar.zs index 4ebe6c0cd..a0dd2d4bf 100644 --- a/wadsrc/static/zscript/games/duke/actors/mortar.zs +++ b/wadsrc/static/zscript/games/duke/actors/mortar.zs @@ -15,7 +15,6 @@ class DukeMortar : DukeActor void Common(int itemmode) { - let Owner = self.ownerActor; let sectp = self.sector; DukePlayer p; double xx; @@ -160,7 +159,7 @@ class DukeBounceMine : DukeMortar { // This is only for placed items, not for armed weapons! // Although this can be shot, it doesn't really work for that. - if (self.ownerActor == self) + if (self.mapSpawned) { self.ownerActor = self; self.extra = gs.impact_damage << 2; diff --git a/wadsrc/static/zscript/games/duke/actors/ooz.zs b/wadsrc/static/zscript/games/duke/actors/ooz.zs index 97c15b2bd..8fc58f747 100644 --- a/wadsrc/static/zscript/games/duke/actors/ooz.zs +++ b/wadsrc/static/zscript/games/duke/actors/ooz.zs @@ -11,7 +11,7 @@ class DukeOoz : DukeActor { self.shade = -12; - if (self.ownerActor && self.OwnerActor != self) + if (!self.mapSpawned) { if (self.actorflag2(SFLAG2_PAL8OOZ)) self.pal = 8; diff --git a/wadsrc/static/zscript/games/duke/actors/rat.zs b/wadsrc/static/zscript/games/duke/actors/rat.zs index 3aa833564..6092e9f1f 100644 --- a/wadsrc/static/zscript/games/duke/actors/rat.zs +++ b/wadsrc/static/zscript/games/duke/actors/rat.zs @@ -12,7 +12,7 @@ class DukeRat : DukeActor override void Initialize() { - if (ownerActor) self.lotag = 0; + if (!self.mapSpawned) self.lotag = 0; if ((self.lotag > ud.player_skill) || ud.monsters_off == 1) { @@ -25,7 +25,7 @@ class DukeRat : DukeActor self.angle = frandom(0, 360); self.cstat = 0; - if (self.ownerActor) + if (!self.mapSpawned && self.ownerActor) { self.timetosleep = 0; self.ChangeStat(STAT_ACTOR); diff --git a/wadsrc/static/zscript/games/duke/actors/recon.zs b/wadsrc/static/zscript/games/duke/actors/recon.zs index 495ce0716..c2032d898 100644 --- a/wadsrc/static/zscript/games/duke/actors/recon.zs +++ b/wadsrc/static/zscript/games/duke/actors/recon.zs @@ -156,7 +156,7 @@ class DukeRecon : DukeActor self.angle += deltaangle(self.angle, (pactor.pos.XY - self.pos.XY).Angle()) * 0.25; } - if (self.temp_data[0] != 2 && self.temp_data[0] != 3 && Owner) + if (self.temp_data[0] != 2 && self.temp_data[0] != 3 && Owner && Owner != self) { double dist = (Owner.pos.XY - self.pos.XY).Length(); if (dist <= 96) diff --git a/wadsrc/static/zscript/games/duke/actors/respawnmarker.zs b/wadsrc/static/zscript/games/duke/actors/respawnmarker.zs index fa9d804bc..2bdc6bae4 100644 --- a/wadsrc/static/zscript/games/duke/actors/respawnmarker.zs +++ b/wadsrc/static/zscript/games/duke/actors/respawnmarker.zs @@ -11,7 +11,7 @@ class DukeRespawnMarker : DukeActor override void Initialize() { - if (ownerActor != self) self.pos.Z = ownerActor.floorZ; + if (!self.mapSpawned && ownerActor != null) self.pos.Z = ownerActor.floorZ; } override void Tick() diff --git a/wadsrc/static/zscript/games/duke/actors/shell.zs b/wadsrc/static/zscript/games/duke/actors/shell.zs index 5b22ad968..b5107c943 100644 --- a/wadsrc/static/zscript/games/duke/actors/shell.zs +++ b/wadsrc/static/zscript/games/duke/actors/shell.zs @@ -11,7 +11,7 @@ class DukeShell : DukeActor void initshell(bool isshell, double direction) { let Owner = self.OwnerActor; - if (Owner && Owner != self) + if (Owner && !self.mapSpawned) { double ang; diff --git a/wadsrc/static/zscript/games/duke/actors/tongue.zs b/wadsrc/static/zscript/games/duke/actors/tongue.zs index 3e7eb7269..239f01bfb 100644 --- a/wadsrc/static/zscript/games/duke/actors/tongue.zs +++ b/wadsrc/static/zscript/games/duke/actors/tongue.zs @@ -9,7 +9,8 @@ class DukeTongue : DukeActor override void Initialize() { - self.angle = self.ownerActor.angle; + if (self.ownerActor && !self.mapSpawned) + self.angle = self.ownerActor.angle; self.pos.Z -= gs.playerheight; self.vel.Z = 1 - frandom(0, 2); self.vel.X = 4 - frandom(0, 8); diff --git a/wadsrc/static/zscript/games/duke/actors/waterdrip.zs b/wadsrc/static/zscript/games/duke/actors/waterdrip.zs index 5bfa8f052..009d71a82 100644 --- a/wadsrc/static/zscript/games/duke/actors/waterdrip.zs +++ b/wadsrc/static/zscript/games/duke/actors/waterdrip.zs @@ -11,7 +11,7 @@ class DukeWaterDrip : DukeActor override void Initialize() { let owner = self.ownerActor; - if (owner && (owner.statnum == STAT_PLAYER || owner.statnum == STAT_ACTOR)) + if (!self.mapSpawned && owner && (owner.statnum == STAT_PLAYER || owner.statnum == STAT_ACTOR)) { self.shade = 32; if (owner.pal != 1) @@ -53,7 +53,7 @@ class DukeWaterDrip : DukeActor if (self.pal != 2 && (self.hitag == 0 || Raze.isRR())) self.PlayActorSound("SOMETHING_DRIPPING"); - if (self.ownerActor != self) + if (!self.mapSpawned) { self.Destroy(); } diff --git a/wadsrc/static/zscript/games/duke/actors/watersplash.zs b/wadsrc/static/zscript/games/duke/actors/watersplash.zs index 506ab8bf3..7c13784af 100644 --- a/wadsrc/static/zscript/games/duke/actors/watersplash.zs +++ b/wadsrc/static/zscript/games/duke/actors/watersplash.zs @@ -11,7 +11,7 @@ class DukeWatersplash : DukeActor { let Owner = self.ownerActor; let sectp = self.sector; - if (Owner) + if (Owner && !self.mapSpawned) { self.SetPosition(Owner.pos); double s = 0.125 + random(0, 7) * REPEAT_SCALE; diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index 4c640bca1..98ac6603a 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -230,7 +230,7 @@ class DukeActor : CoreActor native void commonEnemySetup(bool countkill = true) { - if (self.ownerActor != self) self.lotag = 0; + if (!self.mapSpawned) self.lotag = 0; if ((self.lotag > ud.player_skill) || ud.monsters_off == 1) { @@ -245,7 +245,7 @@ class DukeActor : CoreActor native if (countkill) Duke.GetLocalPlayer().max_actors_killed++; - if (self.ownerActor != self) + if (!self.mapSpawned) { self.timetosleep = 0; self.PlayFTASound();