mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Avoid spr loading freeze when logging
This commit is contained in:
@@ -39,7 +39,7 @@ Game g_game;
|
||||
Game::Game()
|
||||
{
|
||||
resetGameStates();
|
||||
m_protocolVersion = 0;
|
||||
m_clientVersion = 0;
|
||||
}
|
||||
|
||||
void Game::terminate()
|
||||
@@ -430,7 +430,7 @@ void Game::loginWorld(const std::string& account, const std::string& password, c
|
||||
if(m_protocolGame || isOnline())
|
||||
stdext::throw_exception("Unable to login into a world while already online or logging.");
|
||||
|
||||
if(m_protocolVersion == 0)
|
||||
if(m_clientVersion == 0)
|
||||
stdext::throw_exception("Must set a valid game protocol version before logging.");
|
||||
|
||||
// reset the new game state
|
||||
@@ -1123,6 +1123,9 @@ bool Game::canPerformGameAction()
|
||||
|
||||
void Game::setClientVersion(int version)
|
||||
{
|
||||
if(m_clientVersion == version)
|
||||
return;
|
||||
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
@@ -1175,7 +1178,7 @@ void Game::setClientVersion(int version)
|
||||
enableFeature(Otc::GameOfflineTrainingTime);
|
||||
}
|
||||
|
||||
m_protocolVersion = version;
|
||||
m_clientVersion = version;
|
||||
|
||||
Proto::buildMessageModesMap(version);
|
||||
|
||||
|
@@ -242,7 +242,7 @@ public:
|
||||
bool getFeature(Otc::GameFeature feature) { return m_features.test(feature); }
|
||||
|
||||
void setClientVersion(int version);
|
||||
int getClientVersion() { return m_protocolVersion; }
|
||||
int getClientVersion() { return m_clientVersion; }
|
||||
|
||||
bool canPerformGameAction();
|
||||
bool checkBotProtection();
|
||||
@@ -297,7 +297,7 @@ private:
|
||||
std::string m_characterName;
|
||||
std::string m_worldName;
|
||||
std::bitset<Otc::LastGameFeature> m_features;
|
||||
int m_protocolVersion;
|
||||
int m_clientVersion;
|
||||
};
|
||||
|
||||
extern Game g_game;
|
||||
|
Reference in New Issue
Block a user