From fa915e088c7a879aad80568a125fdb39a39fcfdd Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Thu, 2 Feb 2012 21:23:51 -0200 Subject: [PATCH] animate idle creatures --- src/otclient/core/creature.cpp | 4 ++++ src/otclient/core/thing.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/otclient/core/creature.cpp b/src/otclient/core/creature.cpp index 3b542b69..8e180035 100644 --- a/src/otclient/core/creature.cpp +++ b/src/otclient/core/creature.cpp @@ -96,6 +96,10 @@ void Creature::draw(const Point& dest, float scaleFactor, bool animate) // outfit is a real creature if(m_outfit.getCategory() == ThingsType::Creature) { int animationPhase = animate ? m_walkAnimationPhase : 0; + if(isAnimateAlways()) { + int ticksPerFrame = 1000 / getAnimationPhases(); + animationPhase = (g_clock.ticks() % (ticksPerFrame * getAnimationPhases())) / ticksPerFrame; + } // xPattern => creature direction if(m_direction == Otc::NorthEast || m_direction == Otc::SouthEast) diff --git a/src/otclient/core/thing.h b/src/otclient/core/thing.h index f1176274..ffc0a540 100644 --- a/src/otclient/core/thing.h +++ b/src/otclient/core/thing.h @@ -83,6 +83,7 @@ public: bool isHookSouth() { return m_type->properties[ThingType::HookSouth]; } bool isHookEast() { return m_type->properties[ThingType::HookEast]; } bool isStackable() { return m_type->properties[ThingType::IsStackable]; } + bool isAnimateAlways() { return m_type->properties[ThingType::AnimateAlways]; } bool isLyingCorpse() { return m_type->properties[ThingType::IsLyingCorpse]; } bool blocksProjectile() { return m_type->properties[ThingType::BlockProjectile]; } bool isFluid() { return m_type->properties[ThingType::IsFluid]; }