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
ActorSelectorLogic: Keep track of available owners. #14656
Conversation
271b5b7
to
bee54ae
Compare
bee54ae
to
e51738a
Compare
updated testcase: #9364 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could override Tick
in ActorSelectorLogic
and check there to avoid having to add the OnUpdate
stuff.
.OrderBy(p => p.Name); | ||
|
||
selectedOwner = (players.Count() != 0) ? | ||
players.Last() : editorLayer.Players.Players.FirstOrDefault().Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly simpler as:
var multiPlayer = editorLayer.Players.Players.Values
.Where(p => p.Name.StartsWith("Multi"))
.OrderByDescending(p => p.Name)
.FirstOrDefault();
selectedOwner = multiPlayer ?? editorLayer.Players.Players.First().Value;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Looks like a sensible approach overall. |
I will adress this and move this to Tick. |
Any progress here @LipkeGu? |
Closing in favour of #15628. |
This PR implements
OnUpdate()
in ActorSelectorLogic so that theOwnersDropdown.Text
gets updated when owners gets removed (by removing spawn points. It will first try to pick up the last "MultiX" entry otherwise when no "Multi" is found. it will use the first available owner (ex: Neutral).The next part of this PR is the Question "What should happen with placed) Actors
which was owned by a removed Owner?
fixes #9364