From 4e2ded571ec0ff9e4a11713ffb0bdedc426ded61 Mon Sep 17 00:00:00 2001 From: TheSumm Date: Sun, 25 Jan 2015 14:17:16 +0100 Subject: [PATCH] Fixed not being able to relog after reloading gamelib --- modules/gamelib/game.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/gamelib/game.lua b/modules/gamelib/game.lua index 07e985f1..8cd02bdf 100644 --- a/modules/gamelib/game.lua +++ b/modules/gamelib/game.lua @@ -1,7 +1,5 @@ -local currentRsa - function g_game.getRsa() - return currentRsa + return G.currentRsa end function g_game.findPlayerItem(itemId, subType) @@ -19,7 +17,7 @@ function g_game.findPlayerItem(itemId, subType) end function g_game.chooseRsa(host) - if currentRsa ~= CIPSOFT_RSA and currentRsa ~= OTSERV_RSA then return end + if G.currentRsa ~= CIPSOFT_RSA and G.currentRsa ~= OTSERV_RSA then return end if host:ends('.tibia.com') or host:ends('.cipsoft.com') then g_game.setRsa(CIPSOFT_RSA) @@ -29,7 +27,7 @@ function g_game.chooseRsa(host) g_game.setCustomOs(OsTypes.Linux) end else - if currentRsa == CIPSOFT_RSA then + if G.currentRsa == CIPSOFT_RSA then g_game.setCustomOs(-1) end g_game.setRsa(OTSERV_RSA) @@ -44,11 +42,11 @@ end function g_game.setRsa(rsa, e) e = e or '65537' g_crypt.rsaSetPublicKey(rsa, e) - currentRsa = rsa + G.currentRsa = rsa end function g_game.isOfficialTibia() - return currentRsa == CIPSOFT_RSA + return G.currentRsa == CIPSOFT_RSA end function g_game.getSupportedClients() @@ -112,4 +110,6 @@ function g_game.getClientProtocolVersion(client) return clients[client] or client end -g_game.setRsa(OTSERV_RSA) +if not G.currentRsa then + g_game.setRsa(OTSERV_RSA) +end