From 90b9926ca10d6b43e7e7ae485b7e20566142cf0f Mon Sep 17 00:00:00 2001 From: Yves Date: Sat, 22 Mar 2014 23:31:40 +0000 Subject: [PATCH] Fixes warning showing up with the new SpiderMonkey. The changed return value isn't related but returning false makes more sense there IMO. Refs #2372 This was SVN commit r14863. --- binaries/data/mods/public/gui/session/messages.js | 9 ++++++++- .../mods/public/simulation/components/GuiInterface.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/gui/session/messages.js b/binaries/data/mods/public/gui/session/messages.js index 18d00df385..163463902f 100644 --- a/binaries/data/mods/public/gui/session/messages.js +++ b/binaries/data/mods/public/gui/session/messages.js @@ -33,6 +33,9 @@ function handleNotifications() if (!notification) return; + + if (notification.type === undefined) + notification.type = "text"; // Handle chat notifications specially if (notification.type == "chat") @@ -107,7 +110,7 @@ function handleNotifications() } } } - else + else if (notification.type == "text") { // Only display notifications directed to this player if (notification.player == Engine.GetPlayerID()) @@ -121,6 +124,10 @@ function handleNotifications() displayNotifications(); } } + else + { + warn("notification of unknown type!"); + } } function removeOldNotifications() diff --git a/binaries/data/mods/public/simulation/components/GuiInterface.js b/binaries/data/mods/public/simulation/components/GuiInterface.js index c369061a0c..7db1bafa6e 100644 --- a/binaries/data/mods/public/simulation/components/GuiInterface.js +++ b/binaries/data/mods/public/simulation/components/GuiInterface.js @@ -807,7 +807,7 @@ GuiInterface.prototype.GetNextNotification = function() if (this.notifications.length) return this.notifications.pop(); else - return ""; + return false; }; GuiInterface.prototype.GetAvailableFormations = function(player, data)