Skip to content

Multifaction spectator home check#903

Open
Sakura-TA wants to merge 6 commits intorwmt:devfrom
Sakura-TA:Multifaction-SpectatorHomeCheck
Open

Multifaction spectator home check#903
Sakura-TA wants to merge 6 commits intorwmt:devfrom
Sakura-TA:Multifaction-SpectatorHomeCheck

Conversation

@Sakura-TA
Copy link
Copy Markdown
Contributor

This patch is to make all map isPlayerHome check returns if it's any player's home instead of check for spectator's home.
Currently when ticking world componets we fall back to Spectator as factioncontext.
Here's my vision on this check, or on world component tick since normally only this situation the context would fall to spectator.

  1. defautly if a IsPlayerHome check is happened with Spectator, consider it's a isAnyPlayerHome check.
  2. if the check is for specific faction, a previously faction push is needed.
  3. if it's something indenpendently for all player faction, we should use FactionRepeater on them so it fall to 2 to them.
  4. if it's already handled with FactionRepeater but we mis-included spectator should just prevent it from happening instead of make it silent fail as before.

The side reason for me to make this patch is that search for AnyPlayerHome in worldcomponent of spectator will drop to search for gravengine in all the maps, which always iter through all-map-all-things and can cause laggy if AnyPlayerHome is used frequently.

@notfood notfood added fix Fixes for a bug or desync. multifaction Bugs or issues only in multifaction mode. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels May 6, 2026
@notfood notfood moved this to In review in 1.6 and Odyssey May 6, 2026
@notfood
Copy link
Copy Markdown
Member

notfood commented May 6, 2026

It doesn't need to be dynamic. Isn't this preferable?

[HarmonyPatch(typeof(Map), nameof(Map.IsPlayerHome), MethodType.Getter)]

@Sakura-TA
Copy link
Copy Markdown
Contributor Author

Absolutely yes, I was testing with patching AnyPlayerHome but then decide to change my direction and cut into IsPlayerHome, which left it here.

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

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). fix Fixes for a bug or desync. multifaction Bugs or issues only in multifaction mode.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants