forked from mirrors/0ad
Use early return when there is no message
(cherry picked from commit c32a747873)
Signed-off-by: Itms <itms@wildfiregames.com>
This commit is contained in:
@@ -515,13 +515,15 @@ Player.prototype.SetState = function(newState, message)
|
||||
Engine.PostMessage(this.entity, won ? MT_PlayerWon : MT_PlayerDefeated,
|
||||
{ "playerId": this.playerID });
|
||||
|
||||
if (message)
|
||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface).PushNotification({
|
||||
"type": won ? "won" : "defeat",
|
||||
"players": [this.playerID],
|
||||
"allies": [this.playerID],
|
||||
"message": message
|
||||
});
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface).PushNotification({
|
||||
"type": won ? "won" : "defeat",
|
||||
"players": [this.playerID],
|
||||
"allies": [this.playerID],
|
||||
"message": message
|
||||
});
|
||||
};
|
||||
|
||||
Player.prototype.GetFormations = function()
|
||||
|
||||
Reference in New Issue
Block a user