Fix unload-all hotkey for allied buildings
Reviewed by: causative Differential Revision: https://code.wildfiregames.com/D648 This was SVN commit r19878.
This commit is contained in:
parent
9aad0137ba
commit
f876eb86fa
@ -1755,24 +1755,17 @@ function unloadSelection()
|
||||
Engine.PostNetworkCommand({ "type": "unload", "entities": ents, "garrisonHolder": parent });
|
||||
}
|
||||
|
||||
function unloadAllByOwner()
|
||||
{
|
||||
var garrisonHolders = g_Selection.toList().filter(e => {
|
||||
var state = GetEntityState(e);
|
||||
return state && state.garrisonHolder;
|
||||
});
|
||||
Engine.PostNetworkCommand({ "type": "unload-all-by-owner", "garrisonHolders": garrisonHolders });
|
||||
}
|
||||
|
||||
function unloadAll()
|
||||
{
|
||||
// Filter out all entities that aren't garrisonable.
|
||||
var garrisonHolders = g_Selection.toList().filter(e => {
|
||||
var state = GetEntityState(e);
|
||||
let garrisonHolders = g_Selection.toList().filter(e => {
|
||||
let state = GetEntityState(e);
|
||||
return state && state.garrisonHolder;
|
||||
});
|
||||
|
||||
Engine.PostNetworkCommand({ "type": "unload-all", "garrisonHolders": garrisonHolders });
|
||||
Engine.PostNetworkCommand({
|
||||
"type": controlsPlayer(GetEntityState(garrisonHolders[0]).player) ? "unload-all" : "unload-all-by-owner",
|
||||
"garrisonHolders": garrisonHolders
|
||||
});
|
||||
}
|
||||
|
||||
function backToWork()
|
||||
|
@ -1372,7 +1372,7 @@ var g_AllyEntityCommands =
|
||||
},
|
||||
"execute": function(entState)
|
||||
{
|
||||
unloadAllByOwner();
|
||||
unloadAll();
|
||||
},
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user