Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Spring.SetAllyTeamStartBox synced control #958

Merged

Conversation

nbusseneau
Copy link
Contributor

@nbusseneau nbusseneau commented Aug 19, 2023

This new control allows to change an ally team's start box from a synchronized context, thereby opening up the possibility for Lua gadgets to reposition start boxes as needed.

Note

This PR depends on #954 to be merged first: #954 fixes a behaviour discovered while adding this new control, where after repositioning boxes via Spring.SetAllyTeamStartBox some things were working as intended (e.g. display of the startbox is correctly relocated) and some others were not (e.g. clamping of teams start position inside of the ally team startbox), because of the fact AllyTeam data is coming from multiple source.

rts/Lua/LuaSyncedCtrl.cpp Outdated Show resolved Hide resolved
@nbusseneau nbusseneau force-pushed the pr/add-setallyteamstartbox branch from 8f9449d to d809bf5 Compare August 19, 2023 21:37
@nbusseneau nbusseneau requested a review from sprunk August 22, 2023 04:50
@nbusseneau nbusseneau marked this pull request as ready for review August 22, 2023 04:51
doc/changelog.txt Outdated Show resolved Hide resolved
doc/changelog.txt Outdated Show resolved Hide resolved
rts/Sim/Misc/TeamHandler.h Outdated Show resolved Hide resolved
rts/Sim/Misc/TeamHandler.h Outdated Show resolved Hide resolved
rts/Lua/LuaSyncedCtrl.cpp Outdated Show resolved Hide resolved
`AllyTeam` data is first loaded in `CGameSetup` from the start script,
and is later passed down to `TeamHandler` from `CGameSetup`.

Since `TeamHandler` is responsible for storing dynamic information
during the game, whereas `CGameSetup` only stores the initial data as
loaded from the start script, we remove all calls to
`CGameSetup::GetAllyStartingData` in favor of information coming from
`TeamHandler` to ensure that we consistently retrieve up-to-date data.
This new control allows to change an ally team's start box from a
synchronized context, thereby opening up the possibility for Lua gadgets
to reposition start boxes as needed.
@nbusseneau nbusseneau force-pushed the pr/add-setallyteamstartbox branch from d809bf5 to af67703 Compare August 22, 2023 16:42
@sprunk sprunk merged commit e05ebd3 into beyond-all-reason:BAR105 Aug 22, 2023
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.

2 participants