Core/Creature: Implement FarTeleportTo (teleport to an other map)
Core/Transport: Cleanup and optimize transport and passenger handling - Only transports will be active objects - Reduced cpu and memory usage - Using FarTeleportTo for creature passengers at transport teleportation - Creatures won't be recreated on teleport --HG-- branch : trunk
This commit is contained in:
@@ -965,22 +965,8 @@ bool ChatHandler::HandleNpcAddCommand(const char* args)
|
||||
{
|
||||
uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
|
||||
if (tguid > 0)
|
||||
{
|
||||
WorldDatabase.PQuery("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
|
||||
|
||||
TransportCreatureProto *transportCreatureProto = new TransportCreatureProto;
|
||||
transportCreatureProto->guid = tguid;
|
||||
transportCreatureProto->npc_entry = id;
|
||||
uint32 transportEntry = chr->GetTransport()->GetEntry();
|
||||
transportCreatureProto->TransOffsetX = chr->GetTransOffsetX();
|
||||
transportCreatureProto->TransOffsetY = chr->GetTransOffsetY();
|
||||
transportCreatureProto->TransOffsetZ = chr->GetTransOffsetZ();
|
||||
transportCreatureProto->TransOffsetO = chr->GetTransOffsetO();
|
||||
transportCreatureProto->emote = 0;
|
||||
|
||||
sMapMgr.m_TransportNPCMap[transportEntry].insert(transportCreatureProto);
|
||||
sMapMgr.m_TransportNPCs.insert(transportCreatureProto);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user