From 310b56d3f5f61ff07357c5dfe5e4aaeba7f0d6fb Mon Sep 17 00:00:00 2001 From: CrimRecya <335958461@qq.com> Date: Sun, 19 Jan 2025 22:28:03 +0800 Subject: [PATCH] Core --- src/Ext/Bullet/Trajectories/StraightTrajectory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ext/Bullet/Trajectories/StraightTrajectory.cpp b/src/Ext/Bullet/Trajectories/StraightTrajectory.cpp index 1569d9a152..7df6d51909 100644 --- a/src/Ext/Bullet/Trajectories/StraightTrajectory.cpp +++ b/src/Ext/Bullet/Trajectories/StraightTrajectory.cpp @@ -619,7 +619,7 @@ void StraightTrajectory::BulletDetonateLastCheck(BulletClass* pBullet, HouseClas pBullet->SetTarget(pDetonateAt); pBullet->TargetCoords = position; - if (std::abs(velocity) > 1e-10) + if (std::abs(velocity) > 1e-10 && distance < velocity) pBullet->Velocity *= distance / velocity; if (this->ProximityImpact != 0) @@ -634,7 +634,7 @@ void StraightTrajectory::BulletDetonateLastCheck(BulletClass* pBullet, HouseClas if (pType->ProximityDirect) pDetonateAt->ReceiveDamage(&damage, 0, pWH, pBullet->Owner, false, false, pOwner); else - WarheadTypeExt::DetonateAt(pWH, pType->ProximityMedial ? pBullet->Location : position, pBullet->Owner, damage, pOwner, pDetonateAt); + WarheadTypeExt::DetonateAt(pWH, pType->ProximityMedial ? pBullet->Location : position, pBullet->Owner, damage, pOwner, pType->ProximityMedial ? nullptr : pDetonateAt); this->CalculateNewDamage(pBullet); } @@ -923,7 +923,7 @@ void StraightTrajectory::PrepareForDetonateAt(BulletClass* pBullet, HouseClass* if (pType->ProximityDirect) pTechno->ReceiveDamage(&damage, 0, pWH, pBullet->Owner, false, false, pOwner); else - WarheadTypeExt::DetonateAt(pWH, pType->ProximityMedial ? pBullet->Location : pTechno->GetCoords(), pBullet->Owner, damage, pOwner, pTechno); + WarheadTypeExt::DetonateAt(pWH, pType->ProximityMedial ? pBullet->Location : pTechno->GetCoords(), pBullet->Owner, damage, pOwner, pType->ProximityMedial ? nullptr : pTechno); this->CalculateNewDamage(pBullet);