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

Generals: Multiple units can collect from a supply dock at once #681

Open
charliefoxtwo opened this issue Nov 5, 2022 · 0 comments
Open

Comments

@charliefoxtwo
Copy link
Contributor

charliefoxtwo commented Nov 5, 2022

Only one unit should be able to collect from a given supply source at a given time, but in OpenSAGE multiple supply vehicles can collect simultaneously.

Guessing we'll need to add logic similar to what is in DockUpdate:

if (_unitsApproaching.Count > 0)
{
var aiUpdate = _unitsApproaching.Peek();
switch (aiUpdate.SupplyGatherState)
{
case SupplyAIUpdate.SupplyGatherStates.EnqueuedAtSupplyTarget:
aiUpdate.SupplyGatherState = SupplyAIUpdate.SupplyGatherStates.StartDumpingSupplies;
break;
case SupplyAIUpdate.SupplyGatherStates.FinishedDumpingSupplies:
_gameObject.ModelConditionFlags.Set(ModelConditionFlag.DockingActive, true);
aiUpdate.SupplyGatherState = SupplyAIUpdate.SupplyGatherStates.SearchingForSupplySource;
_unitsApproaching.Dequeue();
MoveObjectsForward();
break;
}
}

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

No branches or pull requests

1 participant