[7638] Move linked trap gameobject template checks at gameobject templates loading to function.

This commit is contained in:
VladimirMangos 2009-04-08 20:40:59 +04:00
parent 3f0bef7a32
commit 6c19590062
2 changed files with 19 additions and 40 deletions

View file

@ -5382,6 +5382,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;
@ -5420,19 +5435,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
@ -5469,19 +5472,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
@ -5504,19 +5495,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

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7637" #define REVISION_NR "7638"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__