add missing protocol 8.6 optbyte

master
Eduardo Bart 12 years ago
parent 47bd619273
commit 53bbde0b48

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

@ -244,6 +244,7 @@ void OTClient::registerLuaFunctions()
g_lua.registerClass<Item, Thing>();
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>("getId", &Item::getId);
g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable);

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

@ -165,12 +165,9 @@ void ProtocolGame::parseMessage(InputMessage& msg)
case Proto::GameServerCreatureParty:
parseCreatureShields(msg);
break;
#if PROTOCOL>=870
case Proto::GameServerCreatureUnpass:
msg.getU32(); // creature id
msg.getU8(); // unpassable boolean
parseCreatureUnpass(msg);
break;
#endif
case Proto::GameServerEditText:
parseEditText(msg);
break;
@ -510,7 +507,7 @@ void ProtocolGame::parseOpenNpcTrade(InputMessage& msg)
int listCount = msg.getU8();
for(int i = 0; i < listCount; ++i) {
ItemPtr item = Item::create(msg.getU16());
item->setSubType(msg.getU8());
item->setCountOrSubType(msg.getU8());
std::string name = msg.getString();
int weight = msg.getU32();
@ -690,6 +687,18 @@ void ProtocolGame::parseCreatureShields(InputMessage& msg)
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)
{
uint id = msg.getU32();

Loading…
Cancel
Save