From e9acd74157a326c2f993f48e2752382cd9e1dd4d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 Dec 2022 00:34:17 +0100 Subject: [PATCH] - added a fallback in shoot_* for incompletely ported items. --- source/games/duke/src/player_d.cpp | 1 + source/games/duke/src/player_r.cpp | 1 + source/games/duke/src/vmexports.cpp | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 08089b2ff..bbeafeeb0 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1079,6 +1079,7 @@ void shoot_d(DDukeActor* actor, int atwith, PClass *cls) } } if (cls && cls->IsDescendantOf(RUNTIME_CLASS(DDukeActor)) && CallShootThis(static_cast(GetDefaultByType(cls)), actor, p, spos, sang)) return; + if (cls && atwith == -1) atwith = GetDefaultByType(cls)->spr.picnum; if (isWorldTour()) { // Twentieth Anniversary World Tour diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index d71472ad7..bab32e390 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -815,6 +815,7 @@ void shoot_r(DDukeActor* actor, int atwith, PClass* cls) } } if (cls && cls->IsDescendantOf(RUNTIME_CLASS(DDukeActor)) && CallShootThis(static_cast(GetDefaultByType(cls)), actor, p, spos, sang)) return; + if (cls && atwith == -1) atwith = GetDefaultByType(cls)->spr.picnum; switch (atwith) { diff --git a/source/games/duke/src/vmexports.cpp b/source/games/duke/src/vmexports.cpp index 6ebde1192..4f1b85654 100644 --- a/source/games/duke/src/vmexports.cpp +++ b/source/games/duke/src/vmexports.cpp @@ -651,7 +651,8 @@ void DukeActor_shoot(DDukeActor* act, int intname) if (picnum == -1) { - auto cls = PClass::FindActor(FName(ENamedName(intname))); + auto n = FName(ENamedName(intname)); + auto cls = PClass::FindActor(n); assert(cls); fi.shoot(act, -1, cls); }