Support for newer versions and light draw fix

Avoid drawing light under covered tiles.
This commit is contained in:
conde2 2014-02-24 15:33:29 -03:00
parent 8bd1293be7
commit d080432e14
5 changed files with 14 additions and 3 deletions

View File

@ -54,7 +54,7 @@ function g_game.getSupportedClients()
940, 944, 953, 954, 960, 961, 963, 940, 944, 953, 954, 960, 961, 963,
970, 980, 981, 982, 983, 984, 985, 970, 980, 981, 982, 983, 984, 985,
986, 1001, 1002, 1010, 1020, 1021, 986, 1001, 1002, 1010, 1020, 1021,
1022, 1031 1022, 1031, 1034, 1035
} }
end end

View File

@ -376,6 +376,7 @@ namespace Otc
GamePVPMode = 50, GamePVPMode = 50,
GameWritableDate = 51, GameWritableDate = 51,
GameAdditionalVipInfo = 52, GameAdditionalVipInfo = 52,
GameBaseSkillU16 = 53,
LastGameFeature = 101 LastGameFeature = 101
}; };

View File

@ -1562,6 +1562,10 @@ void Game::setProtocolVersion(int version)
enableFeature(Otc::GamePVPMode); enableFeature(Otc::GamePVPMode);
} }
if (version >= 1035) {
enableFeature(Otc::GameDoubleSkills);
enableFeature(Otc::GameBaseSkillU16);
}
m_protocolVersion = version; m_protocolVersion = version;
Proto::buildMessageModesMap(version); Proto::buildMessageModesMap(version);

View File

@ -139,6 +139,9 @@ void MapView::draw(const Rect& rect)
else else
++it; ++it;
if (g_map.isCovered(tilePos, m_cachedFirstVisibleFloor))
tile->draw(transformPositionTo2D(tilePos, cameraPosition), scaleFactor, drawFlags);
else
tile->draw(transformPositionTo2D(tilePos, cameraPosition), scaleFactor, drawFlags, m_lightView.get()); tile->draw(transformPositionTo2D(tilePos, cameraPosition), scaleFactor, drawFlags, m_lightView.get());
} }

View File

@ -1125,6 +1125,9 @@ void ProtocolGame::parsePlayerSkills(const InputMessagePtr& msg)
int baseLevel; int baseLevel;
if(g_game.getFeature(Otc::GameSkillsBase)) if(g_game.getFeature(Otc::GameSkillsBase))
if (g_game.getFeature(Otc::GameBaseSkillU16))
baseLevel = msg->getU16();
else
baseLevel = msg->getU8(); baseLevel = msg->getU8();
else else
baseLevel = level; baseLevel = level;