Skip to content

Commit

Permalink
[10118] Check gameobject scale at loading (strict DB error filter)
Browse files Browse the repository at this point in the history
This let avoid check scale value at it
  • Loading branch information
VladimirMangos committed Jun 29, 2010
1 parent 9f4ab8d commit e831e6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/game/Object.cpp
Expand Up @@ -124,9 +124,6 @@ void Object::_Create( uint32 guidlow, uint32 entry, HighGuid guidhigh )

void Object::SetObjectScale(float newScale)
{
if (newScale <= 0.0f)
newScale = DEFAULT_OBJECT_SCALE;

SetFloatValue(OBJECT_FIELD_SCALE_X, newScale);
}

Expand Down
8 changes: 8 additions & 0 deletions src/game/ObjectMgr.cpp
Expand Up @@ -6000,6 +6000,14 @@ void ObjectMgr::LoadGameobjectInfo()
if (!goInfo)
continue;


if (goInfo->size <= 0.0f) // prevent use too small scales
{
ERROR_DB_STRICT_LOG("Gameobject (Entry: %u GoType: %u) have too small size=%f",
goInfo->id, goInfo->type, goInfo->size);
const_cast<GameObjectInfo*>(goInfo)->size = DEFAULT_OBJECT_SCALE;
}

// some GO types have unused go template, check goInfo->displayId at GO spawn data loading or ignore

switch(goInfo->type)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10117"
#define REVISION_NR "10118"
#endif // __REVISION_NR_H__

0 comments on commit e831e6f

Please sign in to comment.