From ca042aa0734a5c6dbaa9701c8931d997d2b31bcc Mon Sep 17 00:00:00 2001 From: Thapelo Date: Mon, 27 Jul 2026 21:18:02 +0200 Subject: [PATCH 1/3] fix(PlayerUpdates): upstream-compatible rewrites for cinematic, combat, weather, visibility - Cinematic: replace manual _cinematicMgr->m_cinematicDiff tracking with _cinematicMgr.UpdateCinematic(p_time) single-call pattern - HostileRefMgr: migrate getHostileRefMgr().deleteReferencesOutOfRange() to GetCombatManager().EndCombatBeyondRange() - Weather: replace WeatherMgr::FindWeather/AddWeather pattern with GetMap()->GetOrGenerateZoneDefaultWeather() + SendZoneDynamicInfo() - VisibleNotifier: consolidate two-pass large/non-large visitor into single notifier with VisitFarVisibleObjects - VisitObjects: migrate m_seer-based Cell::VisitObjects to explicit sight-position/map parameter overload fix(FactionFree.sql): remove scale column from creature_template INSERT AC master removed the scale column from creature_template schema. Both Quinley Gearspark and Harleen Gearspark INSERTs updated. --- .../game/Entities/Player/PlayerUpdates.cpp | 41 +++++-------------- sql/world/FactionFree.sql | 4 +- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp b/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp index 5ba53c5..5dd48ba 100644 --- a/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -68,14 +68,8 @@ void Player::Update(uint32 p_time) m_nextMailDelivereTime = time_t(0); } - // Update cinematic location, if 500ms have passed and we're doing a - // cinematic now. - _cinematicMgr->m_cinematicDiff += p_time; - if (_cinematicMgr->m_cinematicCamera && _cinematicMgr->m_activeCinematicCameraId && GetMSTimeDiffToNow(_cinematicMgr->m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF) - { - _cinematicMgr->m_lastCinematicCheck = getMSTime(); - _cinematicMgr->UpdateCinematicLocation(p_time); - } + // Update cinematic camera (if needed) + _cinematicMgr.UpdateCinematic(p_time); // used to implement delayed far teleports SetMustDelayTeleport(true); @@ -396,13 +390,11 @@ void Player::Update(uint32 p_time) // != GetCharmGUID()))) RemovePet(pet, PET_SAVE_NOT_IN_SLOT, true); - // pussywizard: if (m_hostileReferenceCheckTimer <= p_time) { m_hostileReferenceCheckTimer = 15000; if (!GetMap()->IsDungeon()) - getHostileRefMgr().deleteReferencesOutOfRange( - GetVisibilityRange()); + GetCombatManager().EndCombatBeyondRange(GetVisibilityRange(), true); } else m_hostileReferenceCheckTimer -= p_time; @@ -1289,13 +1281,9 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea, bool force) return; if (sWorld->getBoolConfig(CONFIG_WEATHER)) - { - if (Weather* weather = WeatherMgr::FindWeather(zone->ID)) - weather->SendWeatherUpdateToPlayer(this); - else if (!WeatherMgr::AddWeather(zone->ID)) - // send fine weather packet to remove old zone's weather - WeatherMgr::SendFineWeatherUpdateToPlayer(this); - } + GetMap()->GetOrGenerateZoneDefaultWeather(newZone); + + GetMap()->SendZoneDynamicInfo(newZone, this); sScriptMgr->OnPlayerUpdateZone(this, newZone, newArea); @@ -1598,21 +1586,12 @@ void Player::UpdateVisibilityForPlayer(bool mapChange) // After added to map seer must be a player - there is no possibility to // still have different seer (all charm auras must be already removed) if (mapChange && m_seer != this) - { m_seer = this; - } - - Acore::VisibleNotifier notifierNoLarge( - *this, mapChange, - false); // visit only objects which are not large; default distance - Cell::VisitObjects(m_seer, notifierNoLarge, - GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS); - notifierNoLarge.SendToSelf(); - Acore::VisibleNotifier notifierLarge( - *this, mapChange, true); // visit only large objects; maximum distance - Cell::VisitObjects(m_seer, notifierLarge, GetSightRange()); - notifierLarge.SendToSelf(); + Acore::VisibleNotifier notifier(*this, mapChange); + Cell::VisitObjects(GetSightPosition().GetPositionX(), GetSightPosition().GetPositionY(), GetMap(), notifier, GetSightRange()); + Cell::VisitFarVisibleObjects(GetSightPosition().GetPositionX(), GetSightPosition().GetPositionY(), GetMap(), notifier, VISIBILITY_DISTANCE_GIGANTIC); + notifier.SendToSelf(); if (mapChange) m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f, 0.0f); diff --git a/sql/world/FactionFree.sql b/sql/world/FactionFree.sql index 8afb917..7c029c3 100644 --- a/sql/world/FactionFree.sql +++ b/sql/world/FactionFree.sql @@ -81,8 +81,8 @@ INSERT INTO `acore_world`.`npc_text` (`ID`, `text0_0`, `text0_1`, `BroadcastText may have fewer cities or flight paths. They will use entry 500000 and 500001. If these are already in use within your environment, you can change those values here.*/ DELETE FROM `acore_world`.`creature_template` WHERE `entry` BETWEEN 500000 AND 500001; -INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500000, 0, 0, 0, 0, 0, 'Quinley Gearspark', 'Gobl-ome Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 1, 0, 0, 1, 2000, 2000, 1, 1, 8, 512, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); -INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500001, 0, 0, 0, 0, 0, 'Harleen Gearspark', 'Gnom-lin Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 1, 0, 0, 1, 2000, 2000, 1, 1, 1, 512, 2048, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); +INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500000, 0, 0, 0, 0, 0, 'Quinley Gearspark', 'Gobl-ome Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 0, 0, 1, 2000, 2000, 1, 1, 8, 512, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); +INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500001, 0, 0, 0, 0, 0, 'Harleen Gearspark', 'Gnom-lin Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 0, 0, 1, 2000, 2000, 1, 1, 1, 512, 2048, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); /*This will create a series of objects in gameobject_template that were used to add asthetics to the teleport network. They have no purpose other than just to make the area stand out and look better. They will use entry 500000-500004. If these are already in use within your From 7777b02134015b4f92174aa0a2f2c5a228c7a383 Mon Sep 17 00:00:00 2001 From: Thapelo Date: Tue, 28 Jul 2026 02:46:03 +0200 Subject: [PATCH 2/3] fix: add missing Player::AtExitCombat() implementation The method is declared as virtual in Unit.h and overridden in Player.h, but its implementation was in the core's PlayerUpdates.cpp. Since this module replaces the core file, the implementation was stripped out, causing a linker error: undefined reference to Player::AtExitCombat() Copied the implementation from AC master exactly: - Calls Unit::AtExitCombat() - Calls UpdatePotionCooldown() - Resets DK rune grace periods on combat exit --- cpp/src/server/game/Entities/Player/PlayerUpdates.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp b/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp index 5dd48ba..f8521b0 100644 --- a/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/cpp/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -1536,6 +1536,16 @@ void Player::UpdatePvP(bool state, bool _override) sScriptMgr->OnPlayerPVPFlagChange(this, state); } +void Player::AtExitCombat() +{ + Unit::AtExitCombat(); + UpdatePotionCooldown(); + + if (IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_ABILITY)) + for (uint8 i = 0; i < MAX_RUNES; ++i) + SetGracePeriod(i, 0); +} + void Player::UpdatePotionCooldown(Spell* spell) { // no potion used i combat or still in combat From cb0a358291fb1d57c7090fa7a5b918de3062bfc5 Mon Sep 17 00:00:00 2001 From: Thapelo Date: Tue, 28 Jul 2026 03:32:36 +0200 Subject: [PATCH 3/3] fix(FactionFree.sql): update creature_template INSERT for AC schema changes The March 22, 2026 AC update altered creature_template: - DROPPED scale (handled in prior commit) - DROPPED mechanic_immune_mask - DROPPED spell_school_immune_mask - ADDED CreatureImmunitiesId (default 0) Updated both INSERT column lists and value rows accordingly. --- sql/world/FactionFree.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/world/FactionFree.sql b/sql/world/FactionFree.sql index 7c029c3..fac745a 100644 --- a/sql/world/FactionFree.sql +++ b/sql/world/FactionFree.sql @@ -81,8 +81,8 @@ INSERT INTO `acore_world`.`npc_text` (`ID`, `text0_0`, `text0_1`, `BroadcastText may have fewer cities or flight paths. They will use entry 500000 and 500001. If these are already in use within your environment, you can change those values here.*/ DELETE FROM `acore_world`.`creature_template` WHERE `entry` BETWEEN 500000 AND 500001; -INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500000, 0, 0, 0, 0, 0, 'Quinley Gearspark', 'Gobl-ome Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 0, 0, 1, 2000, 2000, 1, 1, 8, 512, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); -INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500001, 0, 0, 0, 0, 0, 'Harleen Gearspark', 'Gnom-lin Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 0, 0, 1, 2000, 2000, 1, 1, 1, 512, 2048, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); +INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `CreatureImmunitiesId`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500000, 0, 0, 0, 0, 0, 'Quinley Gearspark', 'Gobl-ome Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 0, 0, 1, 2000, 2000, 1, 1, 8, 512, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 2, '', 12340); +INSERT INTO `acore_world`.`creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `CreatureImmunitiesId`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES (500001, 0, 0, 0, 0, 0, 'Harleen Gearspark', 'Gnom-lin Engieering Co.', NULL, 0, 35, 35, 0, 474, 1, 1, 1.14286, 1, 1, 18, 0, 0, 1, 2000, 2000, 1, 1, 1, 512, 2048, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1.1, 1, 1, 1, 0, 0, 1, 0, 2, '', 12340); /*This will create a series of objects in gameobject_template that were used to add asthetics to the teleport network. They have no purpose other than just to make the area stand out and look better. They will use entry 500000-500004. If these are already in use within your