mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Cleanup code for UNIT_FIELD_BYTES_1 parts.
Move defines to Unit (values can be used with creatures) Better gameobject barber chairs check at loading.
This commit is contained in:
parent
af888cda40
commit
a1b5c3cb02
10 changed files with 75 additions and 76 deletions
|
|
@ -5688,10 +5688,10 @@ void ObjectMgr::LoadGameobjectInfo()
|
|||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_CHAIR: //7
|
||||
if(goInfo->chair.height > 2)
|
||||
if(goInfo->chair.height > (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR) )
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..2.",
|
||||
id,goInfo->type,goInfo->chair.height);
|
||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..%i.",
|
||||
id,goInfo->type,goInfo->chair.height,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR);
|
||||
|
||||
// prevent client and server unexpected work
|
||||
const_cast<GameObjectInfo*>(goInfo)->chair.height = 0;
|
||||
|
|
@ -5786,6 +5786,16 @@ void ObjectMgr::LoadGameobjectInfo()
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_BARBER_CHAIR: //32
|
||||
if(goInfo->barberChair.chairheight > (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR) )
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..%i.",
|
||||
id,goInfo->type,goInfo->barberChair.chairheight,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR);
|
||||
|
||||
// prevent client and server unexpected work
|
||||
const_cast<GameObjectInfo*>(goInfo)->barberChair.chairheight = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue