diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 1 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Handlers/TradeHandler.cpp | 9 | ||||
-rw-r--r-- | src/server/game/Texts/CreatureTextMgr.cpp | 12 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_sholazar_basin.cpp | 8 |
5 files changed, 23 insertions, 10 deletions
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index f60990a3213..919d033f9f1 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -33,6 +33,7 @@ #define INTERACTION_DISTANCE 5.0f #define ATTACK_DISTANCE 5.0f #define INSPECT_DISTANCE 28.0f +#define TRADE_DISTANCE 11.11f #define MAX_VISIBILITY_DISTANCE SIZE_OF_GRIDS // max distance for visible objects #define SIGHT_RANGE_UNIT 50.0f #define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0348a17768f..3c16cf0df4e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6736,9 +6736,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t if (GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) - GetSession()->SendCancelTrade(); - CheckAreaExploreAndOutdoor(); return true; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 726685044f3..298ae29bfcd 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -337,6 +337,13 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // set before checks for propertly undo at problems (it already set in to client) my_trade->SetAccepted(true); + if (!_player->IsWithinDistInMap(trader, TRADE_DISTANCE, false)) + { + SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); + my_trade->SetAccepted(false); + return; + } + // not accept case incorrect money amount if (!_player->HasEnoughMoney(my_trade->GetMoney())) { @@ -726,7 +733,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (!pOther->IsWithinDistInMap(_player, 10.0f, false)) + if (!pOther->IsWithinDistInMap(_player, TRADE_DISTANCE, false)) { SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); return; diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index fe72e12e7e1..e2d69e1bfc4 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -82,7 +82,7 @@ void CreatureTextMgr::LoadCreatureTexts() if (!result) { - TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); + TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_text` is empty."); return; } @@ -111,20 +111,20 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sSoundEntriesStore.LookupEntry(temp.sound)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); temp.sound = 0; } } if (!GetLanguageDescByID(temp.lang)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); temp.lang = LANG_UNIVERSAL; } if (temp.type >= MAX_CHAT_MSG_TYPE) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); temp.type = CHAT_MSG_SAY; } @@ -132,7 +132,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sEmotesStore.LookupEntry(temp.emote)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); temp.emote = EMOTE_ONESHOT_NONE; } } @@ -141,7 +141,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sObjectMgr->GetBroadcastText(temp.BroadcastTextId)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_texts` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId); temp.BroadcastTextId = 0; } } diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 6e39d341c58..770a95c23d7 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -1021,7 +1021,14 @@ public: void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE { if (apply && passenger->GetTypeId() == TYPEID_PLAYER) + { + /// @workaround - Because accessory gets unmounted when using vehicle_template_accessory. + /// When vehicle spawns accessory is mounted to seat 0,but when player mounts + /// he uses the same seat (instead of mounting to seat 1) kicking the accessory out. + passenger->ChangeSeat(1, false); + me->GetVehicleKit()->InstallAccessory(NPC_PILOT, 0, true, TEMPSUMMON_DEAD_DESPAWN, 0); me->GetMotionMaster()->MovePath(NPC_PLANE, false); + } } void MovementInform(uint32 type, uint32 id) OVERRIDE @@ -1056,6 +1063,7 @@ public: case 25: Talk(PLANE_EMOTE); DoCast(SPELL_ENGINE); + me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT); break; } } |