Skip to content

[Minor] Units of the same type do not attack the same target #1807

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Fly-Star-him
Copy link
Contributor

@Fly-Star-him Fly-Star-him commented Aug 12, 2025

When a weapon has OnlyAttacker=yes, it prevents other units using that weapon from attacking the same target.

  • 当武器存在OnlyAttacker=yes时,它会阻止使用该武器的其他单位攻击同一目标。

@github-actions github-actions bot added the Minor Documentation is not required label Aug 12, 2025
@Fly-Star-him Fly-Star-him changed the title [Minor] Multiple units of the same type do not attack the same target [Minor] Units of the same type do not attack the same target Aug 12, 2025
Copy link

github-actions bot commented Aug 12, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.


void TechnoExt::ExtData::AddFirer(WeaponTypeClass* const Weapon, TechnoClass* const Attacker)
{
if (Attacker->InLimbo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't the limbo Firestarter be recorded?

@@ -310,6 +310,11 @@ DEFINE_HOOK(0x6FC339, TechnoClass_CanFire, 0x6)

if (pTargetTechno)
{
const auto pTargetExt = TechnoExt::ExtMap.Find(pTargetTechno);

if (pWeaponExt->OnlyAttacker.Get() && !pTargetExt->ContainFirer(pWeapon, pThis))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need .Get() I think?


const auto pWeaponExt = WeaponTypeExt::ExtMap.Find(pWeapon);

if (pWeaponExt->OnlyAttacker.Get() && pTarget == pThis->Target
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor Documentation is not required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants