Changeset 18 for trunk/src/game/GameObject.cpp
- Timestamp:
- 11/19/08 13:23:29 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/GameObject.cpp
r2 r18 55 55 m_cooldownTime = 0; 56 56 m_goInfo = NULL; 57 58 m_DBTableGuid = 0; 57 59 } 58 60 … … 109 111 Object::_Create(guidlow, goinfo->id, HIGHGUID_GAMEOBJECT); 110 112 111 m_DBTableGuid = guidlow;112 113 m_goInfo = goinfo; 113 114 … … 479 480 void GameObject::SaveToDB() 480 481 { 481 // this should only be used when the creaturehas already been loaded482 // this should only be used when the gameobject has already been loaded 482 483 // perferably after adding to map, because mapid may not be valid otherwise 483 484 GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid); … … 497 498 if (!goI) 498 499 return; 499 500 501 if (!m_DBTableGuid) 502 m_DBTableGuid = GetGUIDLow(); 500 503 // update in loaded data (changing data only in this place) 501 504 GameObjectData& data = objmgr.NewGOData(m_DBTableGuid); … … 567 570 uint32 go_state = data->go_state; 568 571 569 uint32 stored_guid = guid;572 m_DBTableGuid = guid; 570 573 if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); 571 574 572 575 if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) ) 573 576 return false; 574 575 m_DBTableGuid = stored_guid;576 577 577 578 switch(GetGOInfo()->type) … … 590 591 m_spawnedByDefault = true; 591 592 m_respawnDelayTime = data->spawntimesecs; 592 m_respawnTime = objmgr.GetGORespawnTime( stored_guid, map->GetInstanceId());593 m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); 593 594 594 595 // ready to respawn … … 1159 1160 Player* player = (Player*)user; 1160 1161 1161 if( player->InBattleGround() && // in battleground 1162 !player->IsMounted() && // not mounted 1163 !player->HasStealthAura() && // not stealthed 1164 !player->HasInvisibilityAura() && // not invisible 1165 player->isAlive()) // live player 1166 { 1162 if( player->isAllowUseBattleGroundObject() ) 1163 { 1164 // in battleground check 1167 1165 BattleGround *bg = player->GetBattleGround(); 1168 1166 if(!bg) … … 1187 1185 Player* player = (Player*)user; 1188 1186 1189 if( player->InBattleGround() && // in battleground 1190 !player->IsMounted() && // not mounted 1191 !player->HasStealthAura() && // not stealthed 1192 !player->HasInvisibilityAura() && // not invisible 1193 !player->HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup 1194 player->isAlive()) // live player 1195 { 1187 if( player->isAllowUseBattleGroundObject() ) 1188 { 1189 // in battleground check 1196 1190 BattleGround *bg = player->GetBattleGround(); 1197 1191 if(!bg)