From 241b54262ab2fba35bf01460b27e5d6aecc1bc2f Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 20 Oct 2013 17:15:24 +0200 Subject: [PATCH] Updated lua consts --- modules/gamelib/const.lua | 10 ++++++++++ src/client/const.h | 4 ++-- src/client/game.cpp | 3 ++- src/client/protocolgameparse.cpp | 15 +++++++-------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/modules/gamelib/const.lua b/modules/gamelib/const.lua index eaa5f789..b88a8fd4 100644 --- a/modules/gamelib/const.lua +++ b/modules/gamelib/const.lua @@ -81,6 +81,16 @@ GameNewSpeedLaw = 36 GameForceFirstAutoWalkStep = 37 GameMinimapRemove = 38 GameDoubleShopSellAmount = 39 +GameContainerPagination = 40 +GameThingMarks = 41 +GameLooktypeU16 = 42 +GamePlayerStamina = 43 +GamePlayerAddons = 44 +GameMessageStatements = 45 +GameMesssageLevel = 46 +GameNewFluids = 47 +GamePlayerStateU16 = 48 +GameNewOutfitProtocol = 49 TextColors = { red = '#f55e5e', --'#c83200' diff --git a/src/client/const.h b/src/client/const.h index 6e83c851..d637148a 100644 --- a/src/client/const.h +++ b/src/client/const.h @@ -355,14 +355,14 @@ namespace Otc GameDoubleShopSellAmount = 39, GameContainerPagination = 40, GameThingMarks = 41, - GameLooktypeU16 = 42, GamePlayerStamina = 43, GamePlayerAddons = 44, - GameMessageStatments = 45, + GameMessageStatements = 45, GameMessageLevel = 46, GameNewFluids = 47, GamePlayerStateU16 = 48, + GameNewOutfitProtocol = 49, // 51-100 reserved to be defined in lua LastGameFeature = 101 diff --git a/src/client/game.cpp b/src/client/game.cpp index dcc75d3e..9087a441 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1427,9 +1427,10 @@ void Game::setProtocolVersion(int version) enableFeature(Otc::GamePlayerStamina); enableFeature(Otc::GameNewFluids); enableFeature(Otc::GameMessageLevel); - enableFeature(Otc::GameMessageStatments); + enableFeature(Otc::GameMessageStatements); enableFeature(Otc::GamePlayerStateU16); enableFeature(Otc::GameLooktypeU16); + enableFeature(Otc::GameNewOutfitProtocol); } if(version >= 840) { diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index f216ebf7..aea49247 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -1140,7 +1140,7 @@ void ProtocolGame::parseMultiUseCooldown(const InputMessagePtr& msg) void ProtocolGame::parseTalk(const InputMessagePtr& msg) { - if(g_game.getFeature(Otc::GameMessageStatments)) + if(g_game.getFeature(Otc::GameMessageStatements)) msg->getU32(); // channel statement guid std::string name = g_game.formatCreatureName(msg->getString()); @@ -1397,13 +1397,7 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) Outfit currentOutfit = getOutfit(msg); std::vector > outfitList; - if(g_game.getProtocolVersion() < 780) { - int outfitStart = msg->getU8(); - int outfitEnd = msg->getU8(); - for(int i = outfitStart; i <= outfitEnd; i++) - outfitList.push_back(std::make_tuple(i, "", 0)); - } - else { + if(g_game.getFeature(Otc::GameNewOutfitProtocol)) { int outfitCount = msg->getU8(); for(int i = 0; i < outfitCount; i++) { int outfitId = msg->getU16(); @@ -1412,6 +1406,11 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) outfitList.push_back(std::make_tuple(outfitId, outfitName, outfitAddons)); } + } else { + int outfitStart = msg->getU8(); + int outfitEnd = msg->getU8(); + for(int i = outfitStart; i <= outfitEnd; i++) + outfitList.push_back(std::make_tuple(i, "", 0)); } std::vector > mountList;