Add .debug guidlimits <optional map id> chat command to show the highest low guid counter for Creature and GameObject, useful when reaching Respawn.GuidWarnLevel
(cherry picked from commit 7421ccaf7eb134f549ad3734a815397216d020ed)
Consider the case of Player A inviting Player B to a Calendar Event. After Player B clicks on Accepts/Tentative/Reject, the calendar shows that status for Player A instead.
(cherry picked from commit 7f3d8c99bb14c7b093a5c2419f3e931fef11004e)
On Transport splines use coordinates relative to the transport but if the transport is not found anymore than there is no way to get the absolute coordinates, leading to relative coordinates being used as absolute instead. The result is a Unit being set at position (0, 0, 0) or close by.
(cherry picked from commit c90f789eac9092d5332e92242ed0bfab7fd9e9fe)
* Core/CreatureTemplate: Outsourced resistances and spells into creature_template_spell and creature_template_resistance
* Rename 2019_99_99_00_world.sql to 2019_06_15_01_world.sql
(cherry picked from commit d5fb0a30ec62f3799416326d81d5d14992f9a6df)
* Core/GameEvent: Remove respawn times of Creature and GameObjects when starting/stopping an event
* Add checks for pool
* Remove the check for pools
(cherry picked from commit 678f3dd687432b4229d903a8acfb882c2336e168)
Restore a check about Area ID 0 that would silently ignore this case instead of spamming log errors. Check removed in e79c595b695ea5f35b8324efbb7741ccb102bce9
Fix#23085
(cherry picked from commit bda351d7f1cb3ff663a9d231afa85864ea0f8078)
Use simple std::string concatenation instead of stringstream to avoid including <sstream> header.
(cherry picked from commit 9c790e231ef00c29a33b037ac2ae28d526474539)
Implement GetDebugInfo in MovementGenerator, PathMovementBase, FlightPathMovementGenerator, WaypointMovementGenerator.
Add an additional assert in FlightPathMovementGenerator::DoEventIfAny(), the input node must not be null
(cherry picked from commit 9da81239596bf798b1beafc5ddeaeb37dcc330ff)
Fix an assertion triggered in SplineChainMovementGenerator happening when a new generator is added while last spline of the SplineChainMovementGenerator is being processed but is not finalized yet.
Fix#23077
(cherry picked from commit 5d7f0eef6e2f89d5dbeb0a702f7a35c95626240e)
Add another value to event_param1 for SMART_EVENT_GOSSIP_HELLO to support all cases of OnGossipHello/OnReportUse in GameObjects:
- event_param1 set to 0: execute the action for both OnGossipHello and OnReportUse. This might result in the action being executed twice when clicking the GameObject
- event_param1 set to 1: execute the action for only OnGossipHello
- event_param1 set to 2: execute the action for only OnReportUse
(cherry picked from commit 9e58ef6940c78d92f1553cf7ab75e87a6e2cf112)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*)
* Scripts/Misc: Fix build
* Core/TempSummons: Rename GetSummoner() to GetSummonerUnit()
* Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too
* Fix build
* Core/TempSummons: Allow GameObject to be owner of TempSummon
* Core/TempSummons: Add support to SAI for GameObject owner of TempSummon
* Scripts/Misc: Fix no-pch build
* Core/TempSummons: Implement PR comments
(cherry picked from commit 797fba98e95da1236465a15061ec4122d7ec33fe)
Fix SMART_EVENT_SUMMON_DESPAWNED not working when event_param1 was set to any value other than 0
(cherry picked from commit 457fc224733cc78cedc5e956442a9f5d7bd2f049)
Change the way #22332 moved spell damage calculations from SpellEffectDMG to scripts, using OnEffectLaunchTarget and SetEffectValue instead
(cherry picked from commit 20772dbf5d10c6ec2891a068fb556c9f5fc7d324)
Change assert added in 43dec9e4d0b6f7da3c2051624742e9fb8a9bcb31 to error log since charmed creatures lose their AI until next map update
(cherry picked from commit 70fcdc687d1227a796c03f6353fc8dbfc4f4aea3)
(cherry picked from commit f45ebe71b0d8f6e3008514324a58a92c0db3810e)
The code in Creature::Update() should be modified to wait a few seconds before resetting the hp. PATHFIND_NOPATH / PATHFIND_INCOMPLETE don't really mean that the Creature can't attack the player anyway either.
(cherry picked from commit d910ffd77949f422bd08f12079866962fb53c4dc)
Rename recent GameObject spell overloads (they used to accept only Unit as parameters) to fix GCC warnings about partial function override.
(cherry picked from commit e3a9a9bfb2cba3fc1f6ed616b07fb0ea88de461f)
Add ".debug asan memoryleak" and ".debug asan outofbounds" commands to trigger Address Sanitizer warnings at runtime (or other dynamic analysis tools)
(cherry picked from commit 71d15ea25be3e86646faaa3266617a0b8177972f)
Fix a memory leak in Metric happening only when enabling/disabling Metric from configs at runtime, leaking the metric added between last SendBatch() call and the ScheduleSend() call in the same function. The only way to reproduce this is to actually freeze the thread calling SendBatch(), disable metric, reload config, unfreeze the thread.
(cherry picked from commit 0d1ff7446dce7b0641f49ac55a008669838612cd)
Fix infinite loop in npc_air_force_bots happening when aura 38067 was removed, triggering MoveInLineOfSight() that would add back the aura. Only 1 aura add/remove for guard for player is allowed now.
(cherry picked from commit 844e7ee9262a5ba035ac9e8a6ffc298fb97fd3a9)
Fix .cheat god command still letting you die with Area Aura like Slime near Thaddius, broken since 777b287dff
(cherry picked from commit f26f716714fefa2af4c6e3eea263206682d45236)
Fix crash caused by WorldObject::setActive(false) called after WorldObject::DespawnOrUnsummon() happening because the WorldObject would be set as not active but then Map::RemoveFromActiveHelper() would not be called because of not being in world anymore.
Whenever setActive() gets desync'd with what Map actually contains a rare crash would happen since Map only reads a few values of the active WorldObject, making it hard to reproduce. If this happens again some ASSERT calls should be added (or a check in Map::RemoveFromMap() could be added about if the WorldObject is in Map::m_activeNonPlayers container).
(cherry picked from commit 1c833f28e471e3787f1d328e44af5f065ad9ca8c)
Improve calendar timezone handling by at least creating events with the correct time if both client and server are in the same timezone. There is currently no information received from the client about in which timezone it is.
(cherry picked from commit b33934f6ce9b0227597c712dd6a76b7ed49deea3)
Fallback to shortcut for flying units if Detour returned an incomplete path. This is needed when a flying unit should fly to the floor below to reach the target, but since Recastnavigation doesn't support "jumping down" the unit would not find a path to the target.
(cherry picked from commit d182e5f7e73e614185f4470429467befd6e03981)
Move MMaps related logs from "maps" category to "maps.mmaps".
Remove newlines in logs, the log system already takes care of newlines.
(cherry picked from commit 696039cfed53334ed32583ec293db787e64ef5db)
Fix another infinite loop in Detour caused by degenerated triangles.
Check the result of some previously ignored Detour calls.
Update recastnavigation to 3a619d773deb7e3a15ee215217c825995fe71312 and apply some more custom changes
(cherry picked from commit c602220e02bed1ad76c9e60064eeec5fd97bfe80)
Add rcMedianFilterWalkableArea() to mmaps generation process to simplify some ground/water areas
(cherry picked from commit 7ddbc18aafe61434971013ed6126f5666011ab43)
Add additional assert to check if it's possible for a Pet not to have an active AI when the Player owner kills an enemy.
Ref #23036
(cherry picked from commit 43dec9e4d0b6f7da3c2051624742e9fb8a9bcb31)
Remove UnitScript from PlayerScript and CreatureScript classes as that's how the original system that was PR'd worked, see https://github.com/TrinityCore/TrinityCore/pull/7867 for reference.
Please note these are used as global hooks and should really just invoke stateless functions.
If you need to hook methods from PlayerScript/CreatureScript and UnitScript, just define 2 different scripts (this is how the original system worked and how it was designed to work)
(cherry picked from commit 5b7ead65bb116195f4336934bcff830e1b2af5bb)
Handle StringFormat() exceptions in case of malformed string format to avoid causing unhandled exception crashes
(cherry picked from commit c79811de4fbf2b22cd74f55853516c7fc307055f)
Change the infinite loop fix in Detour to allow looping through all the m_nodePool nodes max once, otherwise it most likely means that we entered an infinite loop. This is currently set to 1024.
(cherry picked from commit 12e6faa0fa0cf389bcebd4a6f2220e71c697250c)
Fix an infinite loop in Detour happening in Dalaran Sewers.
This is more of an emergency patch until we figure out why dtNodes have a circular reference (A -> B -> C -> A) happening quite often in this place
(cherry picked from commit c8ec2dd95d07e3eec00027cdb9605529a49d6475)
Fix memory leak happening when disbanding a group with an ongoing roll.
Please note this is not blizz-like but at least we don't leak memory anymore.
(cherry picked from commit f04e90f638425c0e0ef2e40f0cd29ab7eec625d1)
Fix assert triggered when a spell would trigger another spell in OnEffectHitTarget that would kill the aura owner, then processing the main spell effects. The triggered spell can kill the aura owner, changing its death state to CORPSE and removing auras created.
Fix#21856
Ref 518e6299ca08a362bc3709daaaa5e5d5633d1bf1
(cherry picked from commit 46c7446bd4ef606b1091c1582df50e027fab28b6)
Allow to specify different Recast settings for different maps, currently handled in GetMapSpecificConfig() as a switch statement.
Set walkableRadius to 0 in Blade's Edge Arena (Map ID 562) so the pets can walk on the thin rope between the bridge and the pillar.
(cherry picked from commit e4658a1307b1d52a4e6a0ed67f7dff92f02c090d)
Fix assert triggered when a spell would trigger another spell in OnEffectHitTarget that would kill the target, then processing the main spell effects. The triggered spell can kill the target, changing its death state to CORPSE and removing auras created.
Fix#22306
(cherry picked from commit 518e6299ca08a362bc3709daaaa5e5d5633d1bf1)
Change again how SOAP is stopped if SOAP successfully binds but worldserver fails to bind its sockets.
A crash remains if SOAP fails to bind because it calls exit() and that triggers asserts everywhere.
(cherry picked from commit d05ab073cb102a4f868b0fda51ef4368350ded32)
Fix worldserver entering a loop when having SOAP enabled but failing to bind both SOAP and worldserver listened socket. SOAP thread would keep trying to bind the socket over and over checking World::IsStopped() condition that was never set to true
(cherry picked from commit 85e3169fbd7b2da70e0f054399f4db64ded36325)
* Core/AI: Revamp how UnitAI changes are applied
Revamp how UnitAI changes are applied by storing current AI in a variable and all previous AIs plus current in a stack.
The callers can push/pop AIs on the stack that will take effect only in next Unit::Update() call.
The current AI will be a valid object for the whole duration of Unit::Update() and until next Unit::Update() call.
* Core/AI: Apply new AI change code
* Core/AI: Fix build
* Core/AI: Fix crash on Creature::AIM_Create()
* Core/AI: Fix crash
* Core/AI: Restore ASSERT
* Core/AI: Fix UnitAI not being popped properly when restoring a charmed AI
(cherry picked from commit 8f9654d8176646c3076482477fc4b91011fb83cc)
Replace the output string when a UTF-8 conversion error happen with an error message instead of using an empty string, swallowing any message that the caller wanted to log.
(cherry picked from commit bdb7e6e5e81e0d9376c9c803bae9da470b02d8cd)
Fix issues reported by Address Sanitizer about LoadMinionData() calls on arrays that don't end with a {0, 0} pair.
(cherry picked from commit 08dcee0cf9a56944027d3f65b7fd5c4a4959761c)
* Scripts/Commands: Fix crash caused by .set npc model
Fix crash caused by .set npc model with invalid model id
(cherry picked from commit 20ea24bf5ccf165ce19139d1f7ec7c650719eb68)
Fix crash added in PR #22806 happening in quest "Ruthless Cunning and Returning the Favor"
(cherry picked from commit cb136387218bc7a5473cf1ca6707ec1ba3b8c1c0)
Fix vsnprintf to follow standard definition and not some old VC++ behavior, not requiring to include the '\0' character in the count parameter
(cherry picked from commit eee1f2cadf8174caca4849c22ba1fb8f12fc9e08)
* Core/Misc: Log more information in asserts
Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.
* Core/Misc: Fix dynamic build
Add missing attribute for dynamic build
* Core/Misc: Fix gcc/clang build
* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()
* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'
* Core/Misc: Add GetDebugInfo support to Unit
* Core/Misc: Add GetDebugInfo support to Creature
* Core/Misc: Add more info to GetDebugInfo for Creature
* Core/Misc: Add GetDebugInfo support to GameObject
* Core/Misc: Add GetDebugInfo support to Player
* Core/Misc: Add more GetDebugInfo info
* Core/Misc: Add GetDebugInfo support to Item
* Core/Misc: Add GetDebugInfo support to Bag
* Core/Misc: Add GetDebugInfo support to Transport
* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet
* Core/Misc: Add GetDebugInfo support to Map, InstanceMap
* Core/Misc: Add GetDebugInfo support to Spell
* Core/Misc: Fix build warning
* Core/Misc: Add GetDebugInfo support to Aura
* Core/Misc: Add GetDebugInfo support to UnitAI
(cherry picked from commit 9a924fb9d557434c5a2e4020c80db6e6bfe466ad)
Fix infinite loop in Gyth fight and double event caused by Rend Blackhand being respawned.
Please note this event is completely bugged and unfinished and contains for sure more bugs.
(cherry picked from commit af3449e06463b3425df2ce67195fa55492af4151)