Skip to content

Commit

Permalink
[9556] Allow summoned creatures use MovementType == RANDOM_MOTION_TYPE
Browse files Browse the repository at this point in the history
Using creature_template.MovementType as default. For normal spawned creatures, data from creature table will still apply and override _template.
Radius is 5.0 as default, but may be changed in real-time from ai scripts using function.

Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Mar 9, 2010
1 parent 418e31b commit 7661fe9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/game/Creature.cpp
Expand Up @@ -115,7 +115,7 @@ Creature::Creature(CreatureSubtype subtype) :
Unit(), i_AI(NULL),
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), m_groupLootId(0),
m_lootMoney(0), m_lootRecipient(0),
m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f),
m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(5.0f),
m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0),
m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false),
m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_needNotify(false),
Expand Down Expand Up @@ -271,8 +271,6 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )

// checked at loading
m_defaultMovementType = MovementGeneratorType(cinfo->MovementType);
if(!m_respawnradius && m_defaultMovementType == RANDOM_MOTION_TYPE)
m_defaultMovementType = IDLE_MOTION_TYPE;

return true;
}
Expand Down Expand Up @@ -1889,7 +1887,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
if (ori)
*ori = data->orientation;
if (dist)
*dist = data->spawndist;
*dist = GetRespawnRadius();

return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9555"
#define REVISION_NR "9556"
#endif // __REVISION_NR_H__

1 comment on commit 7661fe9

@DrKLO
Copy link

@DrKLO DrKLO commented on 7661fe9 Mar 18, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commit caused crash on totem summon
http://paste2.org/p/716069

Please sign in to comment.