mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
fix(sql): downgrade Wander to stationary when wanderRadius == 0
Same defect as the empty-Patrol case: Wander behavior with 0 radius would spawn a creature that pretends to wander but never moves. Downgrade to stationary so the export reflects the actual in-game behavior, matching the Patrol-without-waypoints fix.
This commit is contained in:
parent
0736b27ec7
commit
58e0069404
1 changed files with 5 additions and 3 deletions
|
|
@ -114,10 +114,12 @@ bool SQLExporter::exportCreatures(const std::vector<CreatureSpawn>& spawns,
|
|||
uint32_t guid = startEntry + static_cast<uint32_t>(i);
|
||||
|
||||
// movementType: 0=stationary, 1=wander, 2=waypoint (patrol).
|
||||
// Patrol with no waypoints would log an error in AzerothCore at
|
||||
// spawn — fall back to stationary so the spawn still appears.
|
||||
// Patrol with no waypoints or Wander with zero radius would either
|
||||
// log an error or spawn a creature that pretends to wander but
|
||||
// never moves. Downgrade to stationary in both cases.
|
||||
uint8_t movementType = 0;
|
||||
if (s.behavior == CreatureBehavior::Wander) movementType = 1;
|
||||
if (s.behavior == CreatureBehavior::Wander && s.wanderRadius > 0.01f)
|
||||
movementType = 1;
|
||||
if (s.behavior == CreatureBehavior::Patrol && !s.patrolPath.empty())
|
||||
movementType = 2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue