*Remove some code which may cause crash.
--HG-- branch : trunk
This commit is contained in:
@@ -311,8 +311,8 @@ bool OutdoorPvPObjective::DelCreature(uint32 type)
|
|||||||
// explicit removal from map
|
// explicit removal from map
|
||||||
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
|
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
|
||||||
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
|
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
|
||||||
if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
|
//if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
|
||||||
map->Remove(cr,false);
|
// map->Remove(cr,false);
|
||||||
// delete respawn time for this creature
|
// delete respawn time for this creature
|
||||||
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
|
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
|
||||||
cr->AddObjectToRemoveList();
|
cr->AddObjectToRemoveList();
|
||||||
@@ -369,8 +369,8 @@ bool OutdoorPvPObjective::DelCapturePoint()
|
|||||||
// explicit removal from map
|
// explicit removal from map
|
||||||
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
|
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
|
||||||
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
|
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
|
||||||
if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
|
//if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
|
||||||
map->Remove(cr,false);
|
// map->Remove(cr,false);
|
||||||
// delete respawn time for this creature
|
// delete respawn time for this creature
|
||||||
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
|
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
|
||||||
cr->AddObjectToRemoveList();
|
cr->AddObjectToRemoveList();
|
||||||
|
|||||||
@@ -349,8 +349,6 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
|||||||
|
|
||||||
switch(mode)
|
switch(mode)
|
||||||
{
|
{
|
||||||
case PET_SAVE_IN_STABLE_SLOT_1:
|
|
||||||
case PET_SAVE_IN_STABLE_SLOT_2:
|
|
||||||
case PET_SAVE_NOT_IN_SLOT:
|
case PET_SAVE_NOT_IN_SLOT:
|
||||||
{
|
{
|
||||||
RemoveAllAuras();
|
RemoveAllAuras();
|
||||||
@@ -370,8 +368,6 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
|||||||
switch(mode)
|
switch(mode)
|
||||||
{
|
{
|
||||||
case PET_SAVE_AS_CURRENT:
|
case PET_SAVE_AS_CURRENT:
|
||||||
case PET_SAVE_IN_STABLE_SLOT_1:
|
|
||||||
case PET_SAVE_IN_STABLE_SLOT_2:
|
|
||||||
case PET_SAVE_NOT_IN_SLOT:
|
case PET_SAVE_NOT_IN_SLOT:
|
||||||
{
|
{
|
||||||
uint32 owner = GUID_LOPART(GetOwnerGUID());
|
uint32 owner = GUID_LOPART(GetOwnerGUID());
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ enum PetSaveMode
|
|||||||
{
|
{
|
||||||
PET_SAVE_AS_DELETED =-1,
|
PET_SAVE_AS_DELETED =-1,
|
||||||
PET_SAVE_AS_CURRENT = 0,
|
PET_SAVE_AS_CURRENT = 0,
|
||||||
PET_SAVE_IN_STABLE_SLOT_1 = 1,
|
|
||||||
PET_SAVE_IN_STABLE_SLOT_2 = 2,
|
|
||||||
PET_SAVE_NOT_IN_SLOT = 3
|
PET_SAVE_NOT_IN_SLOT = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -16493,8 +16493,9 @@ Pet* Player::GetPet() const
|
|||||||
if(Pet* pet = ObjectAccessor::GetPet(pet_guid))
|
if(Pet* pet = ObjectAccessor::GetPet(pet_guid))
|
||||||
return pet;
|
return pet;
|
||||||
|
|
||||||
sLog.outError("Player::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid));
|
//there may be a guardian in slot
|
||||||
const_cast<Player*>(this)->SetPetGUID(0);
|
//sLog.outError("Player::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid));
|
||||||
|
//const_cast<Player*>(this)->SetPetGUID(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ void TempSummon::Update( uint32 diff )
|
|||||||
|
|
||||||
void TempSummon::InitSummon(uint32 duration)
|
void TempSummon::InitSummon(uint32 duration)
|
||||||
{
|
{
|
||||||
|
assert(!isPet());
|
||||||
|
|
||||||
m_timer = duration;
|
m_timer = duration;
|
||||||
m_lifetime = duration;
|
m_lifetime = duration;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user