Skip to content

Always sync AgentTypeIndexCostOverrides to the landmass agent. - #197

Closed
goulvenclech wants to merge 1 commit into
andriyDev:mainfrom
goulvenclech:fix-overrides-skipping-agent-sync
Closed

goulvenclech wants to merge 1 commit into
andriyDev:mainfrom
goulvenclech:fix-overrides-skipping-agent-sync

Conversation

@goulvenclech

Copy link
Copy Markdown
Contributor

Fixes #196.

Instead of only skipping the update when the component is unchanged, this syncs the overrides every time, like the agent's other inputs. The change check also missed the landmass agent being recreated (switching archipelagos, or the archipelago being added later or replaced), which silently dropped the overrides. Once in sync, it's a few map lookups per agent and allocates nothing.

@andriyDev

Copy link
Copy Markdown
Owner

I don't think I'll be accepting this PR, since it means that we're cloning the type_index_cost_overrides every single frame, which is not ideal. So I wrote my own fix at #198 (with the caveat that it is possible to break it if you add the AgentTypeIndexCostOverrides first, and then add the agent components). I did take your tests though, they were good, thanks!

@andriyDev andriyDev closed this Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unchanged AgentTypeIndexCostOverrides skips pause and animation-link sync

2 participants