* Add error checking for vehicle IDs that are in creature_template but don't

* exist in Vehicle.dbc. This *WILL* cause the client to freeze / hang.
* Look on TDB in the "Core related DB content" forum for a query to clean
* these up.
* Thanks to MaXiMiUS for the slap in the face :)

--HG--
branch : trunk
This commit is contained in:
Brian
2010-02-17 00:51:19 -07:00
parent 777a4361a0
commit bea79b0711

View File

@@ -730,6 +730,13 @@ void ObjectMgr::LoadCreatureTemplates()
const_cast<CreatureInfo*>(cInfo)->InhabitType = INHABIT_ANYWHERE;
}
if (cInfo->VehicleId)
{
VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->Entry);
if (!vehId)
sLog.outErrorDb("Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId);
}
if(cInfo->PetSpellDataId)
{
CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId);