fix(Core/Pet): Standardize pet run speed at 115% rate. (#9478)

Fixes #9230
This commit is contained in:
UltraNix
2021-12-14 17:36:43 +01:00
committed by GitHub
parent 04fd8791e1
commit de0672e9d8

View File

@@ -35,6 +35,7 @@
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "Player.h"
#include "PoolMgr.h"
#include "ScriptedGossip.h"
@@ -408,8 +409,17 @@ bool Creature::InitEntry(uint32 Entry, const CreatureData* data)
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
SetSpeed(MOVE_WALK, cinfo->speed_walk);
SetSpeed(MOVE_RUN, cinfo->speed_run);
float runSpeed = cinfo->speed_run;
if (Pet* pet = ToPet())
{
if (pet->isControlled() && pet->GetOwnerGUID().IsPlayer())
{
runSpeed = 1.15f;
}
}
SetSpeed(MOVE_WALK, cinfo->speed_walk);
SetSpeed(MOVE_RUN, runSpeed);
SetSpeed(MOVE_SWIM, 1.0f); // using 1.0 rate
SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate