diff --git a/modules/game_combatcontrols/combatcontrols.lua b/modules/game_combatcontrols/combatcontrols.lua index 348ae296..9494d755 100644 --- a/modules/game_combatcontrols/combatcontrols.lua +++ b/modules/game_combatcontrols/combatcontrols.lua @@ -22,7 +22,7 @@ local function onFightModeChange(self, selectedFightButton) else fightMode = FightDefensive end - if g_game.getFightMode ~= fightMode then + if g_game.getFightMode() ~= fightMode then g_game.setFightMode(fightMode) end end diff --git a/modules/game_npctrade/npctrade.otui b/modules/game_npctrade/npctrade.otui index 6e7135c5..ab6bb018 100644 --- a/modules/game_npctrade/npctrade.otui +++ b/modules/game_npctrade/npctrade.otui @@ -99,6 +99,7 @@ MainWindow anchors.top: prev.bottom margin-top: 10 margin-right: 5 + image-color: #ffffff88 Label !text: tr('Name:') @@ -186,6 +187,7 @@ MainWindow anchors.left: parent.horizontalCenter anchors.right: parent.right margin-left: 5 + image-color: #ffffff88 Label id: searchLabel diff --git a/src/otclient/core/creature.cpp b/src/otclient/core/creature.cpp index 441ba93e..bb14b453 100644 --- a/src/otclient/core/creature.cpp +++ b/src/otclient/core/creature.cpp @@ -41,21 +41,17 @@ Creature::Creature() : Thing() { - m_healthPercent = 0; - m_showTimedSquare = false; - m_showStaticSquare = false; + m_id = 0; + m_healthPercent = 100; + m_speed = 200; m_direction = Otc::South; m_walkAnimationPhase = 0; - m_walking = false; m_walkInterval = 0; m_walkAnimationInterval = 0; m_walkTurnDirection = Otc::InvalidDirection; m_skull = Otc::SkullNone; m_shield = Otc::ShieldNone; m_emblem = Otc::EmblemNone; - m_shieldBlink = false; - m_showShieldTexture = true; - m_removed = false; m_informationFont = g_fonts.getFont("verdana-11px-rounded"); } @@ -304,16 +300,14 @@ void Creature::walk(const Position& oldPos, const Position& newPos) m_walkTimer.restart(); // calculates walk interval - float interval = 1000; int groundSpeed = 0; - TilePtr oldTile = g_map.getTile(oldPos); if(oldTile) groundSpeed = oldTile->getGroundSpeed(); - if(groundSpeed != 0) + float interval = 1000; + if(groundSpeed > 0 && m_speed > 0) interval = (1000.0f * groundSpeed) / m_speed; - interval = std::ceil(interval / g_game.getServerBeat()) * g_game.getServerBeat(); m_walkAnimationInterval = interval; diff --git a/src/otclient/core/creature.h b/src/otclient/core/creature.h index 1d7ad994..bddfd328 100644 --- a/src/otclient/core/creature.h +++ b/src/otclient/core/creature.h @@ -115,14 +115,14 @@ protected: TexturePtr m_skullTexture; TexturePtr m_shieldTexture; TexturePtr m_emblemTexture; - bool m_showShieldTexture; - bool m_shieldBlink; - bool m_passable; + Boolean m_showShieldTexture; + Boolean m_shieldBlink; + Boolean m_passable; Color m_timedSquareColor; Color m_staticSquareColor; - bool m_showTimedSquare; - bool m_showStaticSquare; - bool m_removed; + Boolean m_showTimedSquare; + Boolean m_showStaticSquare; + Boolean m_removed; FontPtr m_informationFont; Color m_informationColor; @@ -133,7 +133,7 @@ protected: TilePtr m_walkingTile; int m_walkInterval; int m_walkAnimationInterval; - bool m_walking; + Boolean m_walking; ScheduledEventPtr m_walkUpdateEvent; Point m_walkOffset; Otc::Direction m_walkTurnDirection;