Fix 7.6 protocol issue / Typo

This commit is contained in:
Sam 2013-11-19 01:09:31 +01:00
parent 69ae324676
commit ec012cb137
3 changed files with 15 additions and 7 deletions

View File

@ -1229,7 +1229,7 @@ void Game::setPVPMode(Otc::PVPModes pvpMode)
{ {
if(!canPerformGameAction()) if(!canPerformGameAction())
return; return;
if(!g_game.getFeature(Otc::GameFeature::PVPModes)) if(!getFeature(Otc::GamePVPMode))
return; return;
if(m_pvpMode == pvpMode) if(m_pvpMode == pvpMode)
return; return;

View File

@ -30,8 +30,10 @@ int push_luavalue(const Outfit& outfit)
g_lua.setField("type"); g_lua.setField("type");
g_lua.pushInteger(outfit.getAuxId()); g_lua.pushInteger(outfit.getAuxId());
g_lua.setField("auxType"); g_lua.setField("auxType");
if(g_game.getFeature(Otc::GamePlayerAddons)) {
g_lua.pushInteger(outfit.getAddons()); g_lua.pushInteger(outfit.getAddons());
g_lua.setField("addons"); g_lua.setField("addons");
}
g_lua.pushInteger(outfit.getHead()); g_lua.pushInteger(outfit.getHead());
g_lua.setField("head"); g_lua.setField("head");
g_lua.pushInteger(outfit.getBody()); g_lua.pushInteger(outfit.getBody());
@ -54,8 +56,10 @@ bool luavalue_cast(int index, Outfit& outfit)
outfit.setId(g_lua.popInteger()); outfit.setId(g_lua.popInteger());
g_lua.getField("auxType", index); g_lua.getField("auxType", index);
outfit.setAuxId(g_lua.popInteger()); outfit.setAuxId(g_lua.popInteger());
if(g_game.getFeature(Otc::GamePlayerAddons)) {
g_lua.getField("addons", index); g_lua.getField("addons", index);
outfit.setAddons(g_lua.popInteger()); outfit.setAddons(g_lua.popInteger());
}
g_lua.getField("head", index); g_lua.getField("head", index);
outfit.setHead(g_lua.popInteger()); outfit.setHead(g_lua.popInteger());
g_lua.getField("body", index); g_lua.getField("body", index);

View File

@ -705,11 +705,15 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit)
{ {
OutputMessagePtr msg(new OutputMessage); OutputMessagePtr msg(new OutputMessage);
msg->addU8(Proto::ClientChangeOutfit); msg->addU8(Proto::ClientChangeOutfit);
if(g_game.getFeature(Otc::GameLooktypeU16))
msg->addU16(outfit.getId()); msg->addU16(outfit.getId());
else
msg->addU8(outfit.getId());
msg->addU8(outfit.getHead()); msg->addU8(outfit.getHead());
msg->addU8(outfit.getBody()); msg->addU8(outfit.getBody());
msg->addU8(outfit.getLegs()); msg->addU8(outfit.getLegs());
msg->addU8(outfit.getFeet()); msg->addU8(outfit.getFeet());
if(g_game.getFeature(Otc::GamePlayerAddons))
msg->addU8(outfit.getAddons()); msg->addU8(outfit.getAddons());
if(g_game.getFeature(Otc::GamePlayerMounts)) if(g_game.getFeature(Otc::GamePlayerMounts))
msg->addU16(outfit.getMount()); msg->addU16(outfit.getMount());