Skip to content

Commit

Permalink
Add check for spawntimesecsmax at db load
Browse files Browse the repository at this point in the history
Set it to spawntimesecsmin if its loawer than that value.
  • Loading branch information
cyberium committed Apr 14, 2017
1 parent 7b8f382 commit 72dc8b6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/game/ObjectMgr.cpp
Expand Up @@ -1386,6 +1386,13 @@ void ObjectMgr::LoadCreatures()
continue;
}

if (data.spawntimesecsmax < data.spawntimesecsmin)
{
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `spawntimesecsmax` (%u) value lower than `spawntimesecsmin` (%u), it will be adjusted to %u.",
guid, data.id, uint32(data.spawntimesecsmax), uint32(data.spawntimesecsmin), uint32(data.spawntimesecsmin));
data.spawntimesecsmax = data.spawntimesecsmin;
}

if (data.spawnMask & ~spawnMasks[data.mapid])
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid);

Expand Down Expand Up @@ -1626,6 +1633,13 @@ void ObjectMgr::LoadGameObjects()
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but gameobejct marked as despawnable at action.", guid, data.id);
}

if (data.spawntimesecsmax < data.spawntimesecsmin)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecsmax` (%u) value lower than `spawntimesecsmin` (%u), it will be adjusted to %u.",
guid, data.id, uint32(data.spawntimesecsmax), uint32(data.spawntimesecsmin), uint32(data.spawntimesecsmin));
data.spawntimesecsmax = data.spawntimesecsmin;
}

if (go_state >= MAX_GO_STATE)
{
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state);
Expand Down

0 comments on commit 72dc8b6

Please sign in to comment.