[8103] More wide use IsInWorld checks and delayed at teleport operations.

* IsInWorld used to prevent return unexpected not in world objects.
* Delayed operations need to process its in world state.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Ambal 2009-07-01 12:04:58 +04:00 committed by VladimirMangos
parent 9f41772828
commit 9f938a9ed4
17 changed files with 220 additions and 40 deletions

View file

@ -154,6 +154,9 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// resummon pet
GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
//lets process all delayed operations on successful teleport
GetPlayer()->ProcessDelayedOperations();
}
void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
@ -200,6 +203,9 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
// resummon pet
GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
//lets process all delayed operations on successful teleport
GetPlayer()->ProcessDelayedOperations();
}
void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
@ -329,8 +335,8 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
}
else // creature charmed
{
if(Map *map = mover->GetMap())
map->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
if(mover->IsInWorld())
mover->GetMap()->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
}
}