aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-10-26 17:06:50 +0200
committerShauren <shauren.trinity@gmail.com>2013-10-26 17:06:50 +0200
commit75a790ca475c6af31730d331a3ab185f8abdd6e2 (patch)
treef961f8de614ac7e1dfc1f17c68e83c7d14feff20 /src/server/game/Globals/ObjectMgr.cpp
parent8d6aec608f0cd323d291dc12efce32f630590a23 (diff)
parentb81bf7d0250939ee96b942f554c16d950f06c7b1 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index cbc68d8e6cc..8d6be31017b 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -824,6 +824,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<CreatureTemplate*>(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<CreatureTemplate*>(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);
@@ -7802,6 +7814,25 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
return alt;
}
+GameTele const* ObjectMgr::GetGameTeleExactName(const std::string& name) const
+{
+ // explicit name case
+ std::wstring wname;
+ if (!Utf8toWStr(name, wname))
+ return NULL;
+
+ // converting string that we try to find to lower case
+ wstrToLower(wname);
+
+ for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
+ {
+ if (itr->second.wnameLow == wname)
+ return &itr->second;
+ }
+
+ return NULL;
+}
+
bool ObjectMgr::AddGameTele(GameTele& tele)
{
// find max id