From 7a6bf1eeef21b74a14b7c93adf7dd0dabc5f77ba Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 7 Oct 2013 20:18:09 +0100 Subject: [PATCH] only look to localStorage for our player guid WHEN WE'RE LOOKING UP OUR OWN NAME daft error! --- code/player_names.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/player_names.js b/code/player_names.js index d2acee5a..86062520 100644 --- a/code/player_names.js +++ b/code/player_names.js @@ -40,8 +40,10 @@ window.playerNameToGuid = function(playerName) { if (cachedGuid !== undefined) return cachedGuid; // IITC needs our own player GUID, from a lookup by name. so we retrieve this from localstorage (if available) - cachedGuid = localStorage['PLAYER-'+PLAYER.nickname]; - if (cachedGuid !== undefined) return cachedGuid; + if (playerName == PLAYER.nickname) { + cachedGuid = localStorage['PLAYER-'+PLAYER.nickname]; + if (cachedGuid !== undefined) return cachedGuid; + } var guid = null; $.each(Object.keys(sessionStorage), function(ind,key) {