Skip to content

Commit ff4e0aa

Browse files
authored
[Minor] Optimize Interceptor (#1733)
split from #1568. This one is a bit controversial so I'd pull this alone for test and review - instead of selecting weapon for every bullet, used the fixed value from `Interceptor.Weapon` once and for all - added a RearmTimer check for the interceptor process
1 parent 2938be7 commit ff4e0aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Ext/Techno/Body.Update.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ void TechnoExt::ExtData::ApplyInterceptor()
5858
const double guardRangeSq = guardRange * guardRange;
5959
const double minguardRange = pInterceptorType->MinimumGuardRange.Get(pThis);
6060
const double minguardRangeSq = minguardRange * minguardRange;
61+
// Interceptor weapon is always fixed
62+
const auto pWeapon = pThis->GetWeapon(pInterceptorType->Weapon)->WeaponType;
6163

6264
// DO NOT iterate BulletExt::ExtMap here, the order of items is not deterministic
6365
// so it can differ across players throwing target management out of sync.
@@ -76,8 +78,6 @@ void TechnoExt::ExtData::ApplyInterceptor()
7678

7779
if (pBulletTypeExt->Armor.isset())
7880
{
79-
const int weaponIndex = pThis->SelectWeapon(pBullet);
80-
const auto pWeapon = pThis->GetWeapon(weaponIndex)->WeaponType;
8181
const double versus = GeneralUtils::GetWarheadVersusArmor(pWeapon->Warhead, pBulletTypeExt->Armor.Get());
8282

8383
if (versus == 0.0)

0 commit comments

Comments
 (0)