Skip to content

[Minor] Optimize Interceptor #1733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Ext/Techno/Body.Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ void TechnoExt::ExtData::ApplyInterceptor()
const double guardRangeSq = guardRange * guardRange;
const double minguardRange = pInterceptorType->MinimumGuardRange.Get(pThis);
const double minguardRangeSq = minguardRange * minguardRange;
// Interceptor weapon is always fixed
const auto pWeapon = pThis->GetWeapon(pInterceptorType->Weapon)->WeaponType;

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

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

if (versus == 0.0)
Expand Down