Skip to content

Fix the filtering mechanism of weapon range bonus effect in AE#2193

Open
DeathFishAtEase wants to merge 2 commits intoPhobos-developers:developfrom
DeathFishAtEase:WeaponTypeFindOrAllocate
Open

Fix the filtering mechanism of weapon range bonus effect in AE#2193
DeathFishAtEase wants to merge 2 commits intoPhobos-developers:developfrom
DeathFishAtEase:WeaponTypeFindOrAllocate

Conversation

@DeathFishAtEase
Copy link
Copy Markdown
Collaborator

Fixed the bug where WeaponRange.AllowWeapons and WeaponRange.DisallowWeapons only support weapons listed in the [WeaponTypes] list

@DeathFishAtEase DeathFishAtEase added ❓Phobos bug Something isn't working properly Needs testing ⚙️T1 T1 maintainer review is sufficient Bugfix This is a bugfix that does not need documentation beyond mention in changelog labels May 3, 2026
@DeathFishAtEase DeathFishAtEase self-assigned this May 3, 2026
}
}

// Specialization: use FindOrAllocate for weapon vectors, avoiding dependency on [WeaponTypes] registration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not for every abstracttype?

Copy link
Copy Markdown
Collaborator Author

@DeathFishAtEase DeathFishAtEase May 3, 2026

Choose a reason for hiding this comment

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

Out of the principle of minimizing impact
Or rather, I'm not sure how large a scope it is safe to expand to, and if you think it would be better to do so, I'm afraid I would have to ask for your help.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

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.

@Starkku
Copy link
Copy Markdown
Contributor

Starkku commented May 3, 2026

If you're gonna do this might as well do same for WarheadTypeClass, WW(P) used FindOrAllocate for single WH values pretty much everywhere.

Strictly speaking wasn't a bug, more of a technical limitation that is even explicitly listed in docs for some things (may need to go over those now).

@DeathFishAtEase
Copy link
Copy Markdown
Collaborator Author

Strictly speaking wasn't a bug

Ah, initially it was a user who reported to me as a bug that those two INI flags were not working, so I also followed that description.

may need to go over those now

Specifically, what do you think should be done?

@Starkku
Copy link
Copy Markdown
Contributor

Starkku commented May 3, 2026

Specifically, what do you think should be done?

Making sure that whatever you change the docs accurately reflect that. Check where WeaponTypes are parsed into vectors in codebase and check ifthe docs for the appropriate features mention this limitation that's now been lifted.

@DeathFishAtEase
Copy link
Copy Markdown
Collaborator Author

DeathFishAtEase commented May 3, 2026

Specifically, what do you think should be done?

Making sure that whatever you change the docs accurately reflect that. Check where WeaponTypes are parsed into vectors in codebase and check ifthe docs for the appropriate features mention this limitation that's now been lifted.

Currently, aside from the two AE filter flags, there are only two that use ValueableVector<WeaponTypeClass*> , namely SuppressKillWeapons_Types and SuppressRevengeWeapons_Types , and these two do not rely on the list being complete to function, because they compare an already existing weapon pointer (like KillWeapon or RevengeWeapon ) against the list items. Even if a weapon name is dropped from the list due to missing [WeaponTypes] entry, the comparison can still succeed as long as that weapon object itself was created elsewhere via FindOrAllocate . The list is only used as a filter, and the pointer being compared is always valid.

This is why users consider it a bug that the two filter flags of AE cannot support weapons not listed in [WeaponTypes] — among the only four flags that fill in weapon lists, only this pair used for the same function fails to work.

@phoboscn-bot
Copy link
Copy Markdown

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/404/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This is a bugfix that does not need documentation beyond mention in changelog Needs testing ❓Phobos bug Something isn't working properly ⚙️T1 T1 maintainer review is sufficient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants