[7715] Provided way for scripts set alternative gameobject state for client show.

Also use enum for gsmeobject states.
This commit is contained in:
VladimirMangos 2009-04-26 07:14:46 +04:00
parent 1ec21cfb71
commit c2e6dd20dd
10 changed files with 80 additions and 53 deletions

View file

@ -1324,7 +1324,7 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
// so we must create it specific for this instance
GameObject * go = new GameObject;
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, map,
PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
{
sLog.outErrorDb("Gameobject template %u not found in database! BattleGround not created!", entry);
sLog.outError("Cannot create gameobject template %u! BattleGround not created!", entry);
@ -1367,7 +1367,7 @@ void BattleGround::DoorClose(uint32 type)
if (obj)
{
//if doors are open, close it
if (obj->getLootState() == GO_ACTIVATED && !obj->GetGoState())
if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY)
{
//change state to allow door to be closed
obj->SetLootState(GO_READY);