Skip to content

Multifaction spectator home check#903

Merged
notfood merged 7 commits into
rwmt:devfrom
Sakura-TA:Multifaction-SpectatorHomeCheck
May 12, 2026
Merged

Multifaction spectator home check#903
notfood merged 7 commits into
rwmt: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.

@notfood notfood merged commit ccca3fb into rwmt:dev May 12, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In review to Done in 1.6 and Odyssey May 12, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

2 participants