mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
Fix console blue messages
This commit is contained in:
@@ -42,7 +42,6 @@ namespace Otc
|
||||
AWARE_Y_TOP_TILES = AWARE_Y_TILES/2 - 1,
|
||||
AWARE_Y_BOTTOM_TILES = AWARE_Y_TILES/2,
|
||||
|
||||
EFFECT_TICKS_PER_FRAME = 75,
|
||||
INVISIBLE_TICKS_PER_FRAME = 500,
|
||||
ITEM_TICKS_PER_FRAME = 500,
|
||||
ANIMATED_TEXT_DURATION = 1000,
|
||||
|
@@ -31,17 +31,22 @@ void Effect::draw(const Point& dest, float scaleFactor, bool animate)
|
||||
|
||||
int animationPhase = 0;
|
||||
if(animate)
|
||||
animationPhase = std::min((int)(m_animationTimer.ticksElapsed() / Otc::EFFECT_TICKS_PER_FRAME), getAnimationPhases() - 1);
|
||||
animationPhase = std::min((int)(m_animationTimer.ticksElapsed() / m_phaseDuration), getAnimationPhases() - 1);
|
||||
rawGetThingType()->draw(dest, scaleFactor, 0, 0, 0, 0, animationPhase);
|
||||
}
|
||||
|
||||
void Effect::startAnimation()
|
||||
{
|
||||
m_animationTimer.restart();
|
||||
m_phaseDuration = EFFECT_TICKS_PER_FRAME;
|
||||
|
||||
// hack to fix some animation phases duration, currently there is no better solution
|
||||
if(m_id == 33)
|
||||
m_phaseDuration *= 4;
|
||||
|
||||
// schedule removal
|
||||
auto self = asEffect();
|
||||
g_dispatcher.scheduleEvent([self]() { g_map.removeThing(self); }, Otc::EFFECT_TICKS_PER_FRAME * getAnimationPhases());
|
||||
g_dispatcher.scheduleEvent([self]() { g_map.removeThing(self); }, m_phaseDuration * getAnimationPhases());
|
||||
}
|
||||
|
||||
void Effect::setId(uint32 id)
|
||||
|
@@ -30,6 +30,9 @@
|
||||
// @bindclass
|
||||
class Effect : public Thing
|
||||
{
|
||||
enum {
|
||||
EFFECT_TICKS_PER_FRAME = 75
|
||||
};
|
||||
public:
|
||||
void draw(const Point& dest, float scaleFactor, bool animate);
|
||||
|
||||
@@ -46,6 +49,7 @@ public:
|
||||
|
||||
private:
|
||||
Timer m_animationTimer;
|
||||
uint m_phaseDuration;
|
||||
uint16 m_id;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user