Skip to content

Commit 94d57e5

Browse files
Merge AzerothCore 3.3.5 to ElunaAzerothcore [skip ci]
2 parents d6e8f74 + a73b1b2 commit 94d57e5

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- DB update 2026_05_25_00 -> 2026_05_26_00
2+
--
3+
-- Change Target CREATURE_DISTANCE to CLOSEST_FRIENDLY
4+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23960) AND (`source_type` = 0) AND (`id` IN (1, 2));
5+
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
6+
(23960, 0, 1, 0, 0, 0, 100, 2, 5000, 7000, 14000, 17000, 0, 0, 11, 42740, 0, 0, 0, 0, 0, 26, 30, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Runecaster - In Combat - Cast \'Njord`s Rune of Protection\' (Normal Dungeon)'),
7+
(23960, 0, 2, 0, 0, 0, 100, 4, 5000, 7000, 14000, 17000, 0, 0, 11, 59616, 0, 0, 0, 0, 0, 26, 30, 0, 0, 0, 0, 0, 0, 0, 'Dragonflayer Runecaster - In Combat - Cast \'Njord`s Rune of Protection\' (Heroic Dungeon)');

src/server/game/Battlefield/Battlefield.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ Battlefield::~Battlefield()
7676

7777
void Battlefield::HandlePlayerEnterZone(Player* player, uint32 /*zone*/)
7878
{
79+
// Clear any stale entries from a prior visit that did not unwind cleanly.
80+
// Runs before the script hook so scripts see a clean state if they read any
81+
// of these containers.
82+
for (uint8 i = 0; i < PVP_TEAMS_COUNT; ++i)
83+
{
84+
PlayersInWar[i].erase(player->GetGUID());
85+
InvitedPlayers[i].erase(player->GetGUID());
86+
PlayersInQueue[i].erase(player->GetGUID());
87+
PlayersWillBeKick[i].erase(player->GetGUID());
88+
Players[i].erase(player->GetGUID());
89+
}
90+
7991
// Allow scripts to adjust the player's effective team or appearance before
8092
// any team-based battlefield containers (such as player lists or queues) are updated.
8193
sScriptMgr->OnBattlefieldPlayerEnterZone(this, player);
@@ -235,6 +247,9 @@ void Battlefield::InvitePlayerToWar(Player* player)
235247
if (!player)
236248
return;
237249

250+
if (player->IsGameMaster())
251+
return;
252+
238253
/// @todo : needed ?
239254
if (player->IsInFlight())
240255
return;

src/server/scripts/Northrend/zone_wintergrasp.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "ObjectMgr.h"
2929
#include "Player.h"
3030
#include "PoolMgr.h"
31-
#include "RaceMgr.h"
3231
#include "ScriptedCreature.h"
3332
#include "ScriptedGossip.h"
3433
#include "SpellScript.h"
@@ -860,8 +859,12 @@ class go_wg_vehicle_teleporter : public GameObjectScript
860859

861860
bool IsFriendly(Unit* passenger)
862861
{
863-
return ((me->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_HORDE] && passenger->getRaceMask() & sRaceMgr->GetHordeRaceMask()) ||
864-
(me->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_ALLIANCE] && passenger->getRaceMask() & sRaceMgr->GetAllianceRaceMask()));
862+
Player* player = passenger->ToPlayer();
863+
if (!player)
864+
return false;
865+
866+
TeamId goTeam = me->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_HORDE] ? TEAM_HORDE : TEAM_ALLIANCE;
867+
return player->GetTeamId() == goTeam;
865868
}
866869

867870
Creature* IsValidVehicle(Creature* cVeh)

0 commit comments

Comments
 (0)