From 804eadbd15902e61121c43d74f05cdbd511fe3e2 Mon Sep 17 00:00:00 2001 From: Starkku Date: Thu, 31 Oct 2024 14:40:26 +0200 Subject: [PATCH] Fix code for ExtraWarheads/ReturnWeapon concerning FirerHouse --- src/Ext/Bullet/Hooks.DetonateLogics.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ext/Bullet/Hooks.DetonateLogics.cpp b/src/Ext/Bullet/Hooks.DetonateLogics.cpp index 282d0228d4..fa57af68aa 100644 --- a/src/Ext/Bullet/Hooks.DetonateLogics.cpp +++ b/src/Ext/Bullet/Hooks.DetonateLogics.cpp @@ -299,6 +299,8 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5) GET(BulletClass*, pThis, ESI); GET_BASE(CoordStruct*, coords, 0x8); + auto const pOwner = pThis->Owner ? pThis->Owner->Owner : BulletExt::ExtMap.Find(pThis)->FirerHouse; + // Extra warheads if (pThis->WeaponType) { @@ -308,7 +310,6 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5) for (size_t i = 0; i < pWeaponExt->ExtraWarheads.size(); i++) { auto const pWH = pWeaponExt->ExtraWarheads[i]; - auto const pOwner = pThis->Owner ? pThis->Owner->Owner : BulletExt::ExtMap.Find(pThis)->FirerHouse; int damage = defaultDamage; size_t size = pWeaponExt->ExtraWarheads_DamageOverrides.size(); @@ -359,10 +360,8 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5) pWeapon->Damage, pWeapon->Warhead, pWeapon->Speed, pWeapon->Bright)) { pBullet->WeaponType = pWeapon; - auto const pBulletExt = BulletExt::ExtMap.Find(pBullet); - pBulletExt->FirerHouse = pBulletExt->FirerHouse; - pBullet->MoveTo(pThis->Location, BulletVelocity::Empty); + BulletExt::ExtMap.Find(pBullet)->FirerHouse = pOwner; } } }