From e19b1b2ee777a7738fe6073b4a17cb5c55ef69c6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 25 Nov 2020 07:37:17 +0100 Subject: [PATCH] - fixed: IceGuyFX2 set its owner too late. --- src/playsim/p_local.h | 2 -- src/playsim/p_mobj.cpp | 18 ------------------ wadsrc/static/zscript/actors/actor.zs | 4 ++-- wadsrc/static/zscript/actors/hexen/iceguy.zs | 6 +----- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/playsim/p_local.h b/src/playsim/p_local.h index 0f99c07a9..594a3f0b5 100644 --- a/src/playsim/p_local.h +++ b/src/playsim/p_local.h @@ -117,8 +117,6 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL); AActor *P_SpawnMissileZ(AActor* source, double z, AActor* dest, PClassActor *type); AActor *P_SpawnMissileXYZ(DVector3 pos, AActor *source, AActor *dest, PClassActor *type, bool checkspawn = true, AActor *owner = NULL); -AActor *P_SpawnMissileAngle(AActor *source, PClassActor *type, DAngle angle, double vz); -AActor *P_SpawnMissileAngleZ(AActor *source, double z, PClassActor *type, DAngle angle, double vz); AActor *P_SpawnMissileAngleZSpeed(AActor *source, double z, PClassActor *type, DAngle angle, double vz, double speed, AActor *owner = NULL, bool checkspawn = true); AActor *P_SpawnMissileZAimed(AActor *source, double z, AActor *dest, PClassActor *type); diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 38463091b..308c58144 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -6705,24 +6705,6 @@ DEFINE_ACTION_FUNCTION(AActor, OldSpawnMissile) // //--------------------------------------------------------------------------- -AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type, DAngle angle, double vz) -{ - if (source == nullptr || type == nullptr) - { - return NULL; - } - return P_SpawnMissileAngleZSpeed (source, source->Z() + 32 + source->GetBobOffset(), type, angle, vz, GetDefaultSpeed (type)); -} - -AActor *P_SpawnMissileAngleZ (AActor *source, double z, PClassActor *type, DAngle angle, double vz) -{ - if (type == nullptr) - { - return nullptr; - } - return P_SpawnMissileAngleZSpeed (source, z, type, angle, vz, GetDefaultSpeed (type)); -} - AActor *P_SpawnMissileZAimed (AActor *source, double z, AActor *dest, PClassActor *type) { if (source == nullptr || type == nullptr) diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index 2526be303..45662bdce 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -875,9 +875,9 @@ class Actor : Thinker native return SpawnMissileAngleZSpeed (pos.z + 32 + GetBobOffset(), type, angle, vz, GetDefaultSpeed (type)); } - Actor SpawnMissileAngleZ (double z, class type, double angle, double vz) + Actor SpawnMissileAngleZ (double z, class type, double angle, double vz, Actor owner = null) { - return SpawnMissileAngleZSpeed (z, type, angle, vz, GetDefaultSpeed (type)); + return SpawnMissileAngleZSpeed (z, type, angle, vz, GetDefaultSpeed (type), owner); } diff --git a/wadsrc/static/zscript/actors/hexen/iceguy.zs b/wadsrc/static/zscript/actors/hexen/iceguy.zs index c09944f17..6f4c6ad8e 100644 --- a/wadsrc/static/zscript/actors/hexen/iceguy.zs +++ b/wadsrc/static/zscript/actors/hexen/iceguy.zs @@ -169,11 +169,7 @@ class IceGuyFX : Actor { for (int i = 0; i < 8; i++) { - Actor mo = SpawnMissileAngleZ (pos.z+3, "IceGuyFX2", i*45., -0.3); - if (mo) - { - mo.target = target; - } + SpawnMissileAngleZ (pos.z+3, "IceGuyFX2", i*45., -0.3, target); } } }