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,
970, 980, 981, 982, 983, 984, 985,
986, 1001, 1002, 1010, 1020, 1021,
1022, 1031
1022, 1031, 1034, 1035
}
end

View File

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

View File

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

View File

@ -139,7 +139,10 @@ void MapView::draw(const Rect& rect)
else
++it;
tile->draw(transformPositionTo2D(tilePos, cameraPosition), scaleFactor, drawFlags, m_lightView.get());
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());
}
if(drawFlags & Otc::DrawMissiles) {

View File

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