Merge branch 'master' into 4.3.4

Conflicts:
	dep/libmpq/CMakeLists.txt
	src/server/game/Battlefield/BattlefieldMgr.cpp
	src/server/game/Battlefield/BattlefieldMgr.h
	src/server/game/DataStores/DBCStores.cpp
	src/server/game/Entities/Creature/Creature.cpp
	src/server/game/Entities/Creature/Creature.h
	src/server/game/Entities/Object/Object.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Entities/Unit/StatSystem.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Entities/Vehicle/Vehicle.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/GuildHandler.cpp
	src/server/game/Movement/Spline/MoveSplineInit.cpp
	src/server/game/Server/Protocol/Opcodes.cpp
	src/server/game/Server/WorldSession.h
	src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
	src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
	src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
	src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
	src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
	src/server/scripts/EasternKingdoms/boss_kruul.cpp
	src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
	src/server/scripts/Kalimdor/zone_azshara.cpp
	src/server/scripts/Kalimdor/zone_moonglade.cpp
	src/server/scripts/Kalimdor/zone_orgrimmar.cpp
	src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp
	src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
	src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
	src/server/scripts/Spells/spell_dk.cpp
	src/tools/map_extractor/mpq_libmpq.cpp
	src/tools/map_extractor/mpq_libmpq04.h
	src/tools/vmap4_extractor/loadlib/loadlib.h
	src/tools/vmap4_extractor/mpq_libmpq.cpp
	src/tools/vmap4_extractor/mpq_libmpq04.h
This commit is contained in:
DDuarte
2014-01-11 17:26:22 +00:00
1318 changed files with 2645 additions and 2328 deletions
@@ -60,21 +60,26 @@ namespace Movement
{
MoveSpline& move_spline = *unit->movespline;
Location real_position(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZMinusOffset(), unit->GetOrientation());
// Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes
if (unit->GetTransGUID())
{
real_position.x = unit->GetTransOffsetX();
real_position.y = unit->GetTransOffsetY();
real_position.z = unit->GetTransOffsetZ();
real_position.orientation = unit->GetTransOffsetO();
}
bool transport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID();
Location real_position;
// there is a big chance that current position is unknown if current state is not finalized, need compute it
// this also allows calculate spline position and update map position in much greater intervals
// Don't compute for transport movement if the unit is in a motion between two transports
if (!move_spline.Finalized() && move_spline.onTransport == (unit->GetTransGUID() != 0))
real_position = move_spline.ComputePosition();
else
{
Position const* pos;
if (!transport)
pos = unit;
else
pos = &unit->m_movementInfo.transport.pos;
real_position.x = pos->GetPositionX();
real_position.y = pos->GetPositionY();
real_position.z = pos->GetPositionZ();
real_position.orientation = unit->GetOrientation();
}
// should i do the things that user should do? - no.
if (args.path.empty())
@@ -133,14 +138,32 @@ namespace Movement
if (move_spline.Finalized())
return;
Location loc = move_spline.ComputePosition();
bool transport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID();
Location loc;
if (move_spline.onTransport == transport)
loc = move_spline.ComputePosition();
else
{
Position const* pos;
if (!transport)
pos = unit;
else
pos = &unit->m_movementInfo.transport.pos;
loc.x = pos->GetPositionX();
loc.y = pos->GetPositionY();
loc.z = pos->GetPositionZ();
loc.orientation = unit->GetOrientation();
}
args.flags = MoveSplineFlag::Done;
unit->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD);
move_spline.onTransport = transport;
move_spline.Initialize(args);
WorldPacket data(SMSG_MONSTER_MOVE, 64);
data.append(unit->GetPackGUID());
if (unit->GetTransGUID())
if (transport)
{
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
data.appendPackGUID(unit->GetTransGUID());