From 94161a8341a2e0674a265eebf7935e4153fe0d2e Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 18 Oct 2013 12:35:11 +0200 Subject: Core/Creature: Added log/change back to default speed for speed walk / run = 0 (Speed is never zero) --- src/server/game/Globals/ObjectMgr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2f309c07cce..86e6963b1de 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -804,6 +804,18 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if ((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE) TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type); + if (cInfo->speed_walk == 0.0f) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%f) in speed_walk, set to 1.", cInfo->Entry, cInfo->speed_walk); + const_cast(cInfo)->speed_walk = 1.0f; + } + + if (cInfo->speed_run == 0.0f) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%f) in speed_run, set to 1.14286.", cInfo->Entry, cInfo->speed_run); + const_cast(cInfo)->speed_run = 1.14286f; + } + if (cInfo->type && !sCreatureTypeStore.LookupEntry(cInfo->type)) { TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type); -- cgit v1.2.3