add missing protocol 8.6 optbyte

This commit is contained in:
Eduardo Bart 2012-04-28 12:12:02 -03:00
parent 47bd619273
commit 53bbde0b48
4 changed files with 17 additions and 6 deletions

View File

@ -85,7 +85,7 @@ void Item::draw(const Point& dest, float scaleFactor, bool animate)
} else if(m_countOrSubType < 50) { } else if(m_countOrSubType < 50) {
xPattern = 2; xPattern = 2;
yPattern = 1; yPattern = 1;
} else if(m_countOrSubType <= 100) { } else {
xPattern = 3; xPattern = 3;
yPattern = 1; yPattern = 1;
} }

View File

@ -244,6 +244,7 @@ void OTClient::registerLuaFunctions()
g_lua.registerClass<Item, Thing>(); g_lua.registerClass<Item, Thing>();
g_lua.bindClassStaticFunction<Item>("create", &Item::create); g_lua.bindClassStaticFunction<Item>("create", &Item::create);
g_lua.bindClassMemberFunction<Item>("setCount", &Item::setCount);
g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount); g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount);
g_lua.bindClassMemberFunction<Item>("getId", &Item::getId); g_lua.bindClassMemberFunction<Item>("getId", &Item::getId);
g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable); g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable);

View File

@ -145,6 +145,7 @@ private:
void parseCreatureSpeed(InputMessage& msg); void parseCreatureSpeed(InputMessage& msg);
void parseCreatureSkulls(InputMessage& msg); void parseCreatureSkulls(InputMessage& msg);
void parseCreatureShields(InputMessage& msg); void parseCreatureShields(InputMessage& msg);
void parseCreatureUnpass(InputMessage& msg);
void parseCreatureTurn(InputMessage& msg); void parseCreatureTurn(InputMessage& msg);
void parseEditText(InputMessage& msg); void parseEditText(InputMessage& msg);
void parseEditList(InputMessage& msg); void parseEditList(InputMessage& msg);

View File

@ -165,12 +165,9 @@ void ProtocolGame::parseMessage(InputMessage& msg)
case Proto::GameServerCreatureParty: case Proto::GameServerCreatureParty:
parseCreatureShields(msg); parseCreatureShields(msg);
break; break;
#if PROTOCOL>=870
case Proto::GameServerCreatureUnpass: case Proto::GameServerCreatureUnpass:
msg.getU32(); // creature id parseCreatureUnpass(msg);
msg.getU8(); // unpassable boolean
break; break;
#endif
case Proto::GameServerEditText: case Proto::GameServerEditText:
parseEditText(msg); parseEditText(msg);
break; break;
@ -510,7 +507,7 @@ void ProtocolGame::parseOpenNpcTrade(InputMessage& msg)
int listCount = msg.getU8(); int listCount = msg.getU8();
for(int i = 0; i < listCount; ++i) { for(int i = 0; i < listCount; ++i) {
ItemPtr item = Item::create(msg.getU16()); ItemPtr item = Item::create(msg.getU16());
item->setSubType(msg.getU8()); item->setCountOrSubType(msg.getU8());
std::string name = msg.getString(); std::string name = msg.getString();
int weight = msg.getU32(); int weight = msg.getU32();
@ -690,6 +687,18 @@ void ProtocolGame::parseCreatureShields(InputMessage& msg)
logTraceError("could not get greature"); logTraceError("could not get greature");
} }
void ProtocolGame::parseCreatureUnpass(InputMessage& msg)
{
uint id = msg.getU32();
bool unpass = msg.getU8();
CreaturePtr creature = g_map.getCreatureById(id);
if(creature)
creature->setPassable(!unpass);
else
logTraceError("could not get greature");
}
void ProtocolGame::parseCreatureTurn(InputMessage& msg) void ProtocolGame::parseCreatureTurn(InputMessage& msg)
{ {
uint id = msg.getU32(); uint id = msg.getU32();