2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 11:07:44 +00:00

CEnergyProjectile: Properly set hitProjectileOwner

Fixes #359
This commit is contained in:
2020-09-26 10:38:22 -04:00
parent 902b5644f7
commit dad16bf59b
3 changed files with 7 additions and 4 deletions

View File

@@ -35,7 +35,8 @@ bool CTargetableProjectile::Explode(const zeus::CVector3f& pos, const zeus::CVec
const CDamageVulnerability& dVuln, TUniqueId hitActor) {
bool ret = CEnergyProjectile::Explode(pos, normal, type, mgr, dVuln, hitActor);
if (x2e4_24_active || x2c4_ == kInvalidUniqueId || x2c4_ != mgr.GetPlayer().GetUniqueId()) {
if (x2e4_24_active || x2c4_hitProjectileOwner == kInvalidUniqueId ||
x2c4_hitProjectileOwner != mgr.GetPlayer().GetUniqueId()) {
return ret;
}
@@ -43,13 +44,13 @@ bool CTargetableProjectile::Explode(const zeus::CVector3f& pos, const zeus::CVec
TUniqueId uid = mgr.AllocateUniqueId();
zeus::CTransform xf = zeus::lookAt(x170_projectile.GetTranslation(), act->GetAimPosition(mgr, 0.f), zeus::skUp);
auto* projectile = new CEnergyProjectile(true, x3d8_weaponDesc, xf0_weaponType, xf, EMaterialTypes::Player,
x3e0_damage, uid, GetAreaIdAlways(), x2c4_, xec_ownerId,
x3e0_damage, uid, GetAreaIdAlways(), x2c4_hitProjectileOwner, xec_ownerId,
EProjectileAttrib::None, false, zeus::skOne3f, {}, 0xFFFF, false);
mgr.AddObject(projectile);
projectile->AddMaterial(EMaterialTypes::Orbit);
mgr.GetPlayer().ResetAimTargetPrediction(uid);
mgr.GetPlayer().SetOrbitTargetId(uid, mgr);
x2c4_ = kInvalidUniqueId;
x2c4_hitProjectileOwner = kInvalidUniqueId;
}
return ret;