Conversation
| if (Multiplayer.Client == null || ignore) return true; | ||
|
|
||
| var spectatorId = Multiplayer.WorldComp.spectatorFaction.loadID; | ||
| var spectatorId = Multiplayer.WorldComp.spectatorFaction?.loadID; |
There was a problem hiding this comment.
Can null spectatorFaction ever happen? Seems to be forcefully installed even when there is none during MultiplayerWorldComp.ExposeData, it's not tested for null anywhere else either.
There was a problem hiding this comment.
Met one time with VAE...
There was a problem hiding this comment.
If I remember correctly, read it at MapComponent.FinalizeInit can cause issue, I was using new API patching this
https://github.com/Vanilla-Expanded/VanillaAspirationsExpanded/blob/abb0c64efc7861cc04a0f1909eeaa5a4f589aed0/1.5/Source/VAspirE/World%20and%20Map%20Components/WorldComponent_PawnList.cs#L22
Likely when MapComponent.FinalizeInit and WorldComponent.FinalizeInit is calling?
|
|
||
| public void PopFaction(Map map = null) => FactionExtensions.PopFaction(map); | ||
|
|
||
| public void RepeatForWorldFactions(Action action) |
There was a problem hiding this comment.
Wouldn't it be better to share a readonly faction list?
There was a problem hiding this comment.
You mean like we implement a IFacionData to expose factionDatas and ask modders to iter through it themselves?
There was a problem hiding this comment.
I'm struggling with this idea exposing factionData, cuz push/popfaction is serving situations that we set faction data of distinct faction and RepeatFaction serves the iterator through all player-factions so I think all the usages are covered?
Still not a big problem if modders using it wisely though.
paired with rwmt/MultiplayerAPI#13
Hope it works correctly