aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_spell_full.sql5
-rw-r--r--sql/updates/5484_world_scripts.sql1
-rw-r--r--src/game/IdleMovementGenerator.cpp10
-rw-r--r--src/game/IdleMovementGenerator.h4
-rw-r--r--src/game/MotionMaster.cpp3
5 files changed, 15 insertions, 8 deletions
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql
index 7e54af3df84..ebf75e98568 100644
--- a/sql/FULL/world_spell_full.sql
+++ b/sql/FULL/world_spell_full.sql
@@ -2270,4 +2270,7 @@ UPDATE `script_texts` SET `type` = '3' WHERE `entry` IN ('-1532089','-1532090');
# Chicken Net
DELETE FROM `spell_script_target` WHERE `entry` = '51959' and `type` = '1';
-INSERT INTO `spell_script_target` ( `entry`, `type`, `targetEntry`) VALUES ('51959', '1', '28161'); \ No newline at end of file
+INSERT INTO `spell_script_target` ( `entry`, `type`, `targetEntry`) VALUES ('51959', '1', '28161');
+
+# the lurker below
+update creature_template set inhabittype=3 where entry=21217; \ No newline at end of file
diff --git a/sql/updates/5484_world_scripts.sql b/sql/updates/5484_world_scripts.sql
new file mode 100644
index 00000000000..4d468a359ec
--- /dev/null
+++ b/sql/updates/5484_world_scripts.sql
@@ -0,0 +1 @@
+update creature_template set inhabittype=3 where entry=21217; \ No newline at end of file
diff --git a/src/game/IdleMovementGenerator.cpp b/src/game/IdleMovementGenerator.cpp
index 1809d8cd0ca..7c68e3c09f5 100644
--- a/src/game/IdleMovementGenerator.cpp
+++ b/src/game/IdleMovementGenerator.cpp
@@ -57,14 +57,14 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff)
float angle = owner.GetOrientation();
if(m_direction == ROTATE_DIRECTION_LEFT)
{
- angle += diff / m_duration * M_PI * 2;
- if(angle >= M_PI * 2 ) angle = 0;
+ angle += (float)diff * M_PI * 2 / m_maxDuration;
+ while(angle >= M_PI * 2 ) angle -= M_PI * 2;
}
else
{
- angle -= diff / m_duration * M_PI * 2;
- if(angle < 0) angle = M_PI * 2;
- }
+ angle -= (float)diff * M_PI * 2 / m_maxDuration;
+ while(angle < 0) angle += M_PI * 2;
+ }
owner.SetOrientation(angle);
owner.SendMovementFlagUpdate(); // this is a hack. we do not have anything correct to send in the beginning
diff --git a/src/game/IdleMovementGenerator.h b/src/game/IdleMovementGenerator.h
index 1f3f5e81bd4..7251e8b011f 100644
--- a/src/game/IdleMovementGenerator.h
+++ b/src/game/IdleMovementGenerator.h
@@ -39,7 +39,7 @@ extern IdleMovementGenerator si_idleMovement;
class TRINITY_DLL_SPEC RotateMovementGenerator : public MovementGenerator
{
public:
- explicit RotateMovementGenerator(uint32 time, RotateDirection direction) : m_duration(time), m_direction(direction) {}
+ explicit RotateMovementGenerator(uint32 time, RotateDirection direction) : m_duration(time), m_maxDuration(time), m_direction(direction) {}
void Initialize(Unit& owner);
void Finalize(Unit& owner);
@@ -48,7 +48,7 @@ class TRINITY_DLL_SPEC RotateMovementGenerator : public MovementGenerator
MovementGeneratorType GetMovementGeneratorType() { return ROTATE_MOTION_TYPE; }
private:
- uint32 m_duration;
+ uint32 m_duration, m_maxDuration;
RotateDirection m_direction;
};
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index 81d72f8db6f..d77bd83ede2 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -521,6 +521,9 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
{
+ if(!time)
+ return;
+
Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE);
}