fix compile error, rebind trade functions

This commit is contained in:
Eduardo Bart 2012-04-30 23:59:17 -03:00
parent 2f0a151fed
commit 4f08a288ca
6 changed files with 27 additions and 10 deletions

View File

@ -384,9 +384,14 @@ void Game::processCloseNpcTrade()
g_lua.callGlobalField("g_game", "onCloseNpcTrade"); g_lua.callGlobalField("g_game", "onCloseNpcTrade");
} }
void Game::processOpenTrade(const std::string& name, const std::vector<ItemPtr>& items) void Game::processOwnTrade(const std::string& name, const std::vector<ItemPtr>& items)
{ {
g_lua.callGlobalField("g_game", "onOpenTrade", name, items); g_lua.callGlobalField("g_game", "onOwnTrade", name, items);
}
void Game::processCounterTrade(const std::string& name, const std::vector<ItemPtr>& items)
{
g_lua.callGlobalField("g_game", "onCounterTrade", name, items);
} }
void Game::processCloseTrade() void Game::processCloseTrade()

View File

@ -110,7 +110,8 @@ protected:
void processCloseNpcTrade(); void processCloseNpcTrade();
// player trade // player trade
void processOpenTrade(const std::string& name, const std::vector<ItemPtr>& items); void processOwnTrade(const std::string& name, const std::vector<ItemPtr>& items);
void processCounterTrade(const std::string& name, const std::vector<ItemPtr>& items);
void processCloseTrade(); void processCloseTrade();
// edit text/list // edit text/list

View File

@ -26,7 +26,6 @@
#include <framework/core/filestream.h> #include <framework/core/filestream.h>
#include <framework/graphics/graphics.h> #include <framework/graphics/graphics.h>
#include <framework/thirdparty/apngloader.h> #include <framework/thirdparty/apngloader.h>
#include <physfs.h>
SpriteManager g_sprites; SpriteManager g_sprites;

View File

@ -25,7 +25,6 @@
#include <framework/core/declarations.h> #include <framework/core/declarations.h>
#include <framework/graphics/texture.h> #include <framework/graphics/texture.h>
#include <png.h>
class SpriteManager class SpriteManager
{ {

View File

@ -168,7 +168,8 @@ private:
void parseRuleViolationRemove(InputMessage& msg); void parseRuleViolationRemove(InputMessage& msg);
void parseRuleViolationCancel(InputMessage& msg); void parseRuleViolationCancel(InputMessage& msg);
void parseRuleViolationLock(InputMessage& msg); void parseRuleViolationLock(InputMessage& msg);
void parseOpenTrade(InputMessage& msg); void parseOwnTrade(InputMessage& msg);
void parseCounterTrade(InputMessage& msg);
void parseCloseTrade(InputMessage&); void parseCloseTrade(InputMessage&);
void parseTextMessage(InputMessage& msg); void parseTextMessage(InputMessage& msg);
void parseCancelWalk(InputMessage& msg); void parseCancelWalk(InputMessage& msg);

View File

@ -123,10 +123,10 @@ void ProtocolGame::parseMessage(InputMessage& msg)
parseCloseNpcTrade(msg); parseCloseNpcTrade(msg);
break; break;
case Proto::GameServerOwnTrade: case Proto::GameServerOwnTrade:
parseOpenTrade(msg); parseOwnTrade(msg);
break; break;
case Proto::GameServerCounterTrade: case Proto::GameServerCounterTrade:
parseOpenTrade(msg); parseCounterTrade(msg);
break; break;
case Proto::GameServerCloseTrade: case Proto::GameServerCloseTrade:
parseCloseTrade(msg); parseCloseTrade(msg);
@ -545,7 +545,7 @@ void ProtocolGame::parseCloseNpcTrade(InputMessage&)
g_game.processCloseNpcTrade(); g_game.processCloseNpcTrade();
} }
void ProtocolGame::parseOpenTrade(InputMessage& msg) void ProtocolGame::parseOwnTrade(InputMessage& msg)
{ {
std::string name = msg.getString(); std::string name = msg.getString();
int count = msg.getU8(); int count = msg.getU8();
@ -554,7 +554,19 @@ void ProtocolGame::parseOpenTrade(InputMessage& msg)
for(int i = 0; i < count; i++) for(int i = 0; i < count; i++)
items[i] = internalGetItem(msg); items[i] = internalGetItem(msg);
g_game.processOpenTrade(name, items); g_game.processOwnTrade(name, items);
}
void ProtocolGame::parseCounterTrade(InputMessage& msg)
{
std::string name = msg.getString();
int count = msg.getU8();
std::vector<ItemPtr> items(count);
for(int i = 0; i < count; i++)
items[i] = internalGetItem(msg);
g_game.processCounterTrade(name, items);
} }
void ProtocolGame::parseCloseTrade(InputMessage&) void ProtocolGame::parseCloseTrade(InputMessage&)