mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
[7638] Move linked trap gameobject template checks at gameobject templates loading to function. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
SQLGameObjectLoader loader;
|
||||
@@ -5632,19 +5647,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
||||
CheckGOLockId(goInfo,goInfo->chest.lockId,0);
|
||||
|
||||
if(goInfo->chest.linkedTrapId) // linked trap
|
||||
{
|
||||
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);
|
||||
*/
|
||||
}
|
||||
CheckGOLinkedTrapId(goInfo,goInfo->chest.linkedTrapId,7);
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_TRAP: //6
|
||||
@@ -5681,19 +5684,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
||||
}
|
||||
|
||||
if(goInfo->spellFocus.linkedTrapId) // linked trap
|
||||
{
|
||||
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);
|
||||
*/
|
||||
}
|
||||
CheckGOLinkedTrapId(goInfo,goInfo->spellFocus.linkedTrapId,2);
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_GOOBER: //10
|
||||
@@ -5716,19 +5707,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
||||
}
|
||||
*/
|
||||
if(goInfo->goober.linkedTrapId) // linked trap
|
||||
{
|
||||
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);
|
||||
*/
|
||||
}
|
||||
CheckGOLinkedTrapId(goInfo,goInfo->goober.linkedTrapId,12);
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_AREADAMAGE: //12
|
||||
|
||||
Reference in New Issue
Block a user