aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorDoctorKraft <DoctorKraft@users.noreply.github.com>2018-03-05 19:20:42 +0100
committerShauren <shauren.trinity@gmail.com>2018-03-05 19:20:42 +0100
commit58930d273fca5b7cd92f0f5ff987890d50373c59 (patch)
tree12942f2d2140f56d6d402e755fb27704bf91d3a6 /src/server/game
parentf411b7a90e4900c9e2df7c1e0c7a301360408cec (diff)
Core/Players: Fixed mounts using MOUNT_FLAG_SELF_MOUNT flag (#21558)
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/DataStores/DB2Structure.h2
-rw-r--r--src/server/game/Entities/Unit/Unit.h1
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp27
3 files changed, 20 insertions, 10 deletions
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index 9148ab9070d..19274a61b06 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -1882,6 +1882,8 @@ struct MountEntry
uint32 ID;
uint32 PlayerConditionId;
int32 UiModelSceneID;
+
+ bool IsSelfMount() const { return (Flags & MOUNT_FLAG_SELF_MOUNT) != 0; }
};
struct MountCapabilityEntry
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index c099161dfe3..ef8fb3d97a9 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -37,6 +37,7 @@
#define WORLD_TRIGGER 12999
#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE 197886
#define SPELL_DH_DOUBLE_JUMP 196055
+#define DISPLAYID_HIDDEN_MOUNT 73200
enum SpellModOp : uint8
{
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 01bf86a3421..971e2b41ffb 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2543,18 +2543,25 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
{
if (DB2Manager::MountXDisplayContainer const* mountDisplays = sDB2Manager.GetMountDisplays(mountEntry->ID))
{
- DB2Manager::MountXDisplayContainer usableDisplays;
- std::copy_if(mountDisplays->begin(), mountDisplays->end(), std::back_inserter(usableDisplays), [target](MountXDisplayEntry const* mountDisplay)
+ if (mountEntry->IsSelfMount())
{
- if (Player* playerTarget = target->ToPlayer())
- if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mountDisplay->PlayerConditionID))
- return sConditionMgr->IsPlayerMeetingCondition(playerTarget, playerCondition);
+ displayId = DISPLAYID_HIDDEN_MOUNT;
+ }
+ else
+ {
+ DB2Manager::MountXDisplayContainer usableDisplays;
+ std::copy_if(mountDisplays->begin(), mountDisplays->end(), std::back_inserter(usableDisplays), [target](MountXDisplayEntry const* mountDisplay)
+ {
+ if (Player* playerTarget = target->ToPlayer())
+ if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mountDisplay->PlayerConditionID))
+ return sConditionMgr->IsPlayerMeetingCondition(playerTarget, playerCondition);
- return true;
- });
+ return true;
+ });
- if (!usableDisplays.empty())
- displayId = Trinity::Containers::SelectRandomContainerElement(usableDisplays)->DisplayID;
+ if (!usableDisplays.empty())
+ displayId = Trinity::Containers::SelectRandomContainerElement(usableDisplays)->DisplayID;
+ }
}
// TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue)
//if (MountVehicle const* mountVehicle = sObjectMgr->GetMountVehicle(mountEntry->Id))
@@ -2565,7 +2572,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
{
vehicleId = creatureInfo->VehicleId;
- if (!displayId || vehicleId)
+ if (!displayId)
{
displayId = ObjectMgr::ChooseDisplayId(creatureInfo);
sObjectMgr->GetCreatureModelRandomGender(&displayId);