Skip to content

Commit

Permalink
Fix code for ExtraWarheads/ReturnWeapon concerning FirerHouse
Browse files Browse the repository at this point in the history
  • Loading branch information
Starkku committed Oct 31, 2024
1 parent 0449bdd commit 31f2f2a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Ext/Bullet/Hooks.DetonateLogics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
// Extra warheads
if (pThis->WeaponType)
{
auto const pOwner = pThis->Owner ? pThis->Owner->Owner : BulletExt::ExtMap.Find(pThis)->FirerHouse;
auto const pWeaponExt = WeaponTypeExt::ExtMap.Find(pThis->WeaponType);
int defaultDamage = pThis->WeaponType->Damage;

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();

Expand Down Expand Up @@ -359,9 +359,6 @@ 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);
}
}
Expand Down

0 comments on commit 31f2f2a

Please sign in to comment.