Skip to content

Commit 804eadb

Browse files
committed
Fix code for ExtraWarheads/ReturnWeapon concerning FirerHouse
1 parent 0449bdd commit 804eadb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Ext/Bullet/Hooks.DetonateLogics.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
299299
GET(BulletClass*, pThis, ESI);
300300
GET_BASE(CoordStruct*, coords, 0x8);
301301

302+
auto const pOwner = pThis->Owner ? pThis->Owner->Owner : BulletExt::ExtMap.Find(pThis)->FirerHouse;
303+
302304
// Extra warheads
303305
if (pThis->WeaponType)
304306
{
@@ -308,7 +310,6 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
308310
for (size_t i = 0; i < pWeaponExt->ExtraWarheads.size(); i++)
309311
{
310312
auto const pWH = pWeaponExt->ExtraWarheads[i];
311-
auto const pOwner = pThis->Owner ? pThis->Owner->Owner : BulletExt::ExtMap.Find(pThis)->FirerHouse;
312313
int damage = defaultDamage;
313314
size_t size = pWeaponExt->ExtraWarheads_DamageOverrides.size();
314315

@@ -359,10 +360,8 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
359360
pWeapon->Damage, pWeapon->Warhead, pWeapon->Speed, pWeapon->Bright))
360361
{
361362
pBullet->WeaponType = pWeapon;
362-
auto const pBulletExt = BulletExt::ExtMap.Find(pBullet);
363-
pBulletExt->FirerHouse = pBulletExt->FirerHouse;
364-
365363
pBullet->MoveTo(pThis->Location, BulletVelocity::Empty);
364+
BulletExt::ExtMap.Find(pBullet)->FirerHouse = pOwner;
366365
}
367366
}
368367
}

0 commit comments

Comments
 (0)