diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 633868049..14b11731a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1158,7 +1158,6 @@ set (PCH_SOURCES g_inventory/a_weapons.cpp g_strife/strife_sbar.cpp g_shared/a_action.cpp - g_shared/a_bridge.cpp g_shared/a_decals.cpp g_shared/a_fastprojectile.cpp g_shared/a_flashfader.cpp diff --git a/src/g_shared/a_bridge.cpp b/src/g_shared/a_bridge.cpp deleted file mode 100644 index 06fbb6ad3..000000000 --- a/src/g_shared/a_bridge.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "actor.h" -#include "info.h" -#include "gi.h" - -// Custom bridge -------------------------------------------------------- - -class ACustomBridge : public AActor -{ - DECLARE_CLASS (ACustomBridge, AActor) -public: - void OnDestroy() override; -}; - -IMPLEMENT_CLASS(ACustomBridge, false, false) - -void ACustomBridge::OnDestroy() -{ - // Hexen originally just set a flag to make the bridge balls remove themselves in A_BridgeOrbit. - // But this is not safe with custom bridge balls that do not necessarily call that function. - // So the best course of action is to look for all bridge balls here and destroy them ourselves. - - TThinkerIterator it; - AActor *thing; - - while ((thing = it.Next())) - { - if (thing->target == this) - { - thing->Destroy(); - } - } - Super::OnDestroy(); -} diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index 862aafeb4..51e59ec08 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -1290,7 +1290,7 @@ CCMD(clearnodecache) } catch (CRecoverableError &err) { - Printf("%s", err.GetMessage()); + Printf("%s\n", err.GetMessage()); return; } diff --git a/wadsrc/static/zscript/shared/bridge.txt b/wadsrc/static/zscript/shared/bridge.txt index db482b216..9446ac12c 100644 --- a/wadsrc/static/zscript/shared/bridge.txt +++ b/wadsrc/static/zscript/shared/bridge.txt @@ -70,7 +70,7 @@ class BridgeBall : Actor // The bridge itself ------------------------------------------------------- -class CustomBridge : Actor native +class CustomBridge : Actor { const ORBIT_RADIUS = 15; @@ -114,6 +114,26 @@ class CustomBridge : Actor native A_SetRenderStyle(1., STYLE_Normal); } } + + override void OnDestroy() + { + // Hexen originally just set a flag to make the bridge balls remove themselves in A_BridgeOrbit. + // But this is not safe with custom bridge balls that do not necessarily call that function. + // So the best course of action is to look for all bridge balls here and destroy them ourselves. + + let it = ThinkerIterator.Create("Actor"); + Actor thing; + + while ((thing = Actor(it.Next()))) + { + if (thing.target == self) + { + thing.Destroy(); + } + } + Super.OnDestroy(); + } + void A_BridgeInit(class balltype = "BridgeBall") {