[7638] Move linked trap gameobject template checks at gameobject templates loading to function. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
+18
-39
@@ -5594,6 +5594,21 @@ inline void CheckGOLockId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
|
|||||||
goInfo->id,goInfo->type,N,goInfo->door.lockId,goInfo->door.lockId);
|
goInfo->id,goInfo->type,N,goInfo->door.lockId,goInfo->door.lockId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void CheckGOLinkedTrapId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
|
||||||
|
{
|
||||||
|
if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(dataN))
|
||||||
|
{
|
||||||
|
if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
|
||||||
|
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
|
||||||
|
goInfo->id,goInfo->type,N,dataN,dataN,GAMEOBJECT_TYPE_TRAP);
|
||||||
|
}
|
||||||
|
/* disable check for while (too many error reports baout not existed in trap templates
|
||||||
|
else
|
||||||
|
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
|
||||||
|
goInfo->id,goInfo->type,N,dataN,dataN);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectMgr::LoadGameobjectInfo()
|
void ObjectMgr::LoadGameobjectInfo()
|
||||||
{
|
{
|
||||||
SQLGameObjectLoader loader;
|
SQLGameObjectLoader loader;
|
||||||
@@ -5632,19 +5647,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
|||||||
CheckGOLockId(goInfo,goInfo->chest.lockId,0);
|
CheckGOLockId(goInfo,goInfo->chest.lockId,0);
|
||||||
|
|
||||||
if(goInfo->chest.linkedTrapId) // linked trap
|
if(goInfo->chest.linkedTrapId) // linked trap
|
||||||
{
|
CheckGOLinkedTrapId(goInfo,goInfo->chest.linkedTrapId,7);
|
||||||
if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(goInfo->chest.linkedTrapId))
|
|
||||||
{
|
|
||||||
if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
|
|
||||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data7=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
|
|
||||||
id,goInfo->type,goInfo->chest.linkedTrapId,goInfo->chest.linkedTrapId,GAMEOBJECT_TYPE_TRAP);
|
|
||||||
}
|
|
||||||
/* disable check for while
|
|
||||||
else
|
|
||||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
|
|
||||||
id,goInfo->type,goInfo->chest.linkedTrapId,goInfo->chest.linkedTrapId);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GAMEOBJECT_TYPE_TRAP: //6
|
case GAMEOBJECT_TYPE_TRAP: //6
|
||||||
@@ -5681,19 +5684,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(goInfo->spellFocus.linkedTrapId) // linked trap
|
if(goInfo->spellFocus.linkedTrapId) // linked trap
|
||||||
{
|
CheckGOLinkedTrapId(goInfo,goInfo->spellFocus.linkedTrapId,2);
|
||||||
if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(goInfo->spellFocus.linkedTrapId))
|
|
||||||
{
|
|
||||||
if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
|
|
||||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
|
|
||||||
id,goInfo->type,goInfo->spellFocus.linkedTrapId,goInfo->spellFocus.linkedTrapId,GAMEOBJECT_TYPE_TRAP);
|
|
||||||
}
|
|
||||||
/* disable check for while
|
|
||||||
else
|
|
||||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
|
|
||||||
id,goInfo->type,goInfo->spellFocus.linkedTrapId,goInfo->spellFocus.linkedTrapId);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GAMEOBJECT_TYPE_GOOBER: //10
|
case GAMEOBJECT_TYPE_GOOBER: //10
|
||||||
@@ -5716,19 +5707,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if(goInfo->goober.linkedTrapId) // linked trap
|
if(goInfo->goober.linkedTrapId) // linked trap
|
||||||
{
|
CheckGOLinkedTrapId(goInfo,goInfo->goober.linkedTrapId,12);
|
||||||
if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(goInfo->goober.linkedTrapId))
|
|
||||||
{
|
|
||||||
if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
|
|
||||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data12=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
|
|
||||||
id,goInfo->type,goInfo->goober.linkedTrapId,goInfo->goober.linkedTrapId,GAMEOBJECT_TYPE_TRAP);
|
|
||||||
}
|
|
||||||
/* disable check for while
|
|
||||||
else
|
|
||||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data12=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
|
|
||||||
id,goInfo->type,goInfo->goober.linkedTrapId,goInfo->goober.linkedTrapId);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GAMEOBJECT_TYPE_AREADAMAGE: //12
|
case GAMEOBJECT_TYPE_AREADAMAGE: //12
|
||||||
|
|||||||
Reference in New Issue
Block a user