improvment in connect

This commit is contained in:
Eduardo Bart
2012-02-08 20:58:27 -02:00
parent 175f97b98f
commit 55fbb5f1a6
9 changed files with 26 additions and 19 deletions

View File

@@ -473,19 +473,19 @@ void Creature::setOutfit(const Outfit& outfit)
void Creature::setSkull(uint8 skull)
{
m_skull = skull;
g_lua.callGlobalField("Creature","onSkullChange", asCreature(), m_skull);
callLuaField("onSkullChange", m_skull);
}
void Creature::setShield(uint8 shield)
{
m_shield = shield;
g_lua.callGlobalField("Creature","onShieldChange", asCreature(), m_shield);
callLuaField("onShieldChange", m_shield);
}
void Creature::setEmblem(uint8 emblem)
{
m_emblem = emblem;
g_lua.callGlobalField("Creature","onEmblemChange", asCreature(), m_emblem);
callLuaField("onEmblemChange", m_emblem);
}
void Creature::setSkullTexture(const std::string& filename)

View File

@@ -26,6 +26,7 @@
#include <otclient/global.h>
class Map;
class Game;
class MapView;
class Tile;
class Thing;

View File

@@ -21,10 +21,7 @@
*/
#include "effect.h"
#include "thingstype.h"
#include "map.h"
#include "tile.h"
#include <framework/core/clock.h>
#include <framework/core/eventdispatcher.h>
void Effect::draw(const Point& dest, float scaleFactor, bool animate)

View File

@@ -64,7 +64,7 @@ void Game::processConnectionError(const boost::system::error_code& error)
void Game::processDisconnect()
{
if(isOnline()) {
// only process logout event if a previous the player is known
// only process logout event if the player is known
if(m_localPlayer->isKnown())
processLogout();
@@ -86,7 +86,7 @@ void Game::processLoginError(const std::string& error)
void Game::processLoginAdvice(const std::string& message)
{
g_lua.callGlobalField("Game," "onLoginAdvice", message);
g_lua.callGlobalField("g_game", "onLoginAdvice", message);
}
void Game::processLoginWait(const std::string& message, int time)
@@ -113,7 +113,7 @@ void Game::processGameEnd()
{
g_lua.callGlobalField("g_game", "onGameEnd");
// reset game states
// reset game state
resetGameStates();
}
@@ -232,9 +232,7 @@ void Game::processOpenContainer(int containerId, int itemId, const std::string&
void Game::processContainerAddItem(int containerId, const ItemPtr& item)
{
if(item)
item->setPosition(Position(65535, containerId + 0x40, 0));
item->setPosition(Position(65535, containerId + 0x40, 0));
g_lua.callGlobalField("g_game", "onContainerAddItem", containerId, item);
}

View File

@@ -156,5 +156,3 @@ void LocalPlayer::terminateWalk()
Creature::terminateWalk();
m_preWalking = false;
}