From ec012cb1370abe72cbc8afaf3f9aad360c9652af Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 19 Nov 2013 01:09:31 +0100 Subject: [PATCH] Fix 7.6 protocol issue / Typo --- src/client/game.cpp | 2 +- src/client/luavaluecasts.cpp | 12 ++++++++---- src/client/protocolgamesend.cpp | 8 ++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/client/game.cpp b/src/client/game.cpp index 7a090cd4..2b69212c 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1229,7 +1229,7 @@ void Game::setPVPMode(Otc::PVPModes pvpMode) { if(!canPerformGameAction()) return; - if(!g_game.getFeature(Otc::GameFeature::PVPModes)) + if(!getFeature(Otc::GamePVPMode)) return; if(m_pvpMode == pvpMode) return; diff --git a/src/client/luavaluecasts.cpp b/src/client/luavaluecasts.cpp index cc787695..bf4a4874 100644 --- a/src/client/luavaluecasts.cpp +++ b/src/client/luavaluecasts.cpp @@ -30,8 +30,10 @@ int push_luavalue(const Outfit& outfit) g_lua.setField("type"); g_lua.pushInteger(outfit.getAuxId()); g_lua.setField("auxType"); - g_lua.pushInteger(outfit.getAddons()); - g_lua.setField("addons"); + if(g_game.getFeature(Otc::GamePlayerAddons)) { + g_lua.pushInteger(outfit.getAddons()); + g_lua.setField("addons"); + } g_lua.pushInteger(outfit.getHead()); g_lua.setField("head"); g_lua.pushInteger(outfit.getBody()); @@ -54,8 +56,10 @@ bool luavalue_cast(int index, Outfit& outfit) outfit.setId(g_lua.popInteger()); g_lua.getField("auxType", index); outfit.setAuxId(g_lua.popInteger()); - g_lua.getField("addons", index); - outfit.setAddons(g_lua.popInteger()); + if(g_game.getFeature(Otc::GamePlayerAddons)) { + g_lua.getField("addons", index); + outfit.setAddons(g_lua.popInteger()); + } g_lua.getField("head", index); outfit.setHead(g_lua.popInteger()); g_lua.getField("body", index); diff --git a/src/client/protocolgamesend.cpp b/src/client/protocolgamesend.cpp index aaa05d4c..5d677323 100644 --- a/src/client/protocolgamesend.cpp +++ b/src/client/protocolgamesend.cpp @@ -705,12 +705,16 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit) { OutputMessagePtr msg(new OutputMessage); msg->addU8(Proto::ClientChangeOutfit); - msg->addU16(outfit.getId()); + if(g_game.getFeature(Otc::GameLooktypeU16)) + msg->addU16(outfit.getId()); + else + msg->addU8(outfit.getId()); msg->addU8(outfit.getHead()); msg->addU8(outfit.getBody()); msg->addU8(outfit.getLegs()); msg->addU8(outfit.getFeet()); - msg->addU8(outfit.getAddons()); + if(g_game.getFeature(Otc::GamePlayerAddons)) + msg->addU8(outfit.getAddons()); if(g_game.getFeature(Otc::GamePlayerMounts)) msg->addU16(outfit.getMount()); send(msg);