mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7638] Move linked trap gameobject template checks at gameobject templates loading to function.
This commit is contained in:
parent
3f0bef7a32
commit
6c19590062
2 changed files with 19 additions and 40 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
@ -5420,19 +5435,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
|
||||
|
|
@ -5469,19 +5472,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
|
||||
|
|
@ -5504,19 +5495,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue