Commit Graph

531 Commits

Author SHA1 Message Date
Shauren
472384e757 Core/Objects: Add overridable function UpdateObjectVisibilityOnDestroy 2022-01-29 15:18:27 +01:00
Giacomo Pozzoni
61bf51874d Core/Misc: Fix static analysis issues (#25178)
(cherry picked from commit 7cf122fc2a)
2022-01-24 20:21:25 +01:00
Peter Keresztes Schmidt
44ea32ace4 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2022-01-23 22:16:15 +01:00
jackpoz
68faf5bc4b Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...")
(cherry picked from commit 54c701cf0d)
2022-01-19 22:17:42 +01:00
Giacomo Pozzoni
07f42907c6 Log number of Creatures and GameObject per map (#24809)
* Shared/Metric: Allow to specify tags in metrics

* Core/Metric: Log number of Creatures and GameObject per map

* Apply feedback

* Codestyle changes

* Codestyle changes

* Remove whitespace

* Update Grafana dashboards to v7.0.3

* Fix missing filter on realm

* Include Creatures and Gameobjects in Maps dashboard

* Show instances with a different color

(cherry picked from commit 4e1dbd1cf8)
2022-01-06 23:15:07 +01:00
Giacomo Pozzoni
1ba940b17a Core/Maps: Change .map file version from FourCC to uint32 (#26326)
(cherry picked from commit 42877e75e2)
2022-01-04 20:44:25 +01:00
NoName
0aa98a5bc9 Core/Maps: fix respawn times for manual respawns (#24571)
by joshwhedon

(cherry picked from commit 5bbab32793)
2022-01-02 13:56:18 +01:00
Giacomo Pozzoni
97c1d01cbb Core/Pooling: Remove respawn times from the database when despawning a pool (#24422)
* Core/Pooling: Remove respawn times from the database when despawning a pool

Remove respawn times from the database when despawning a pool. This is needed when a Game Event ends but there are still some respawn times saved in the database.

* Remove respawn time of active pool objects even if they are not spawned

(cherry picked from commit 4f33fd3932)
2022-01-01 14:02:00 +01:00
Giacomo Pozzoni
a9e325f6b7 Core/Logs: Log full guid instead of just low guid, part 2
(cherry picked from commit 3def52c1c4)
2022-01-01 00:51:54 +01:00
Giacomo Pozzoni
6ec933f281 Core/Logs: Log full guid instead of just low guid
(cherry picked from commit 468ecb7252)
2021-12-31 21:56:40 +01:00
Matan Shukry
8fabe5a3aa Core/Phasing: Implemented db spawns in personal phases (#26345)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-12-28 13:24:10 +01:00
Treeston
ea0aa63d96 Core/Misc: C++17 cleanups, commit 2, the advstd commit
(cherry picked from commit 857f8d9231)
2021-12-24 00:37:21 +01:00
Shauren
e8d1f37ee0 Core/Maps: Citizens of Dalaran! Raise your eyes to the skies and observe! Any non-map-default light can now be overriden!
Closes #24250

(cherry picked from commit e10313b380)
2021-12-22 21:51:33 +01:00
ForesterDev
5e178b30fa Core/DynamicInfo: rename some parameters according packet definitions (#24192)
(cherry picked from commit 5cfce94619)
2021-12-22 14:54:59 +01:00
Treeston
94a79bac7a Core/Misc: Some refactoring, #23603 prep: (#23676)
- Split SpawnMetadata off from SpawnData
- No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
(cherry picked from commit 9304e496cb)
2021-12-21 15:16:26 +01:00
xvwyh
9b79d1b410 Core/DynamicObjects: Restore the ability of DynamicObjects to be world objects which was accidentally removed in f0f4a620fb breaking Far Sight (#24046)
Fixes #17081

(cherry picked from commit d4ba47a76e)
2021-12-20 21:22:37 +01:00
jackpoz
e6ac3316b7 Core/Map: Load the grid of TempSummons owned by Players
Ensure to load the grid of TempSummons owned by Players when the relocate to another cell

(cherry picked from commit afbc478919)
2021-12-19 13:14:33 +01:00
jackpoz
044cb4ff34 Core/Map: Move a log from ERROR to WARN
Move "Could not load MMAP" log from ERROR to WARN as 99% of times is a false positive

(cherry picked from commit 42ab6010f8)
2021-12-18 22:21:01 +01:00
Shauren
8f3904f8fd Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster
(cherry picked from commit 3a4216fd97)
2021-12-18 20:57:38 +01:00
Treeston
8c3eb07889 Scripts/FollowerAI: Some cleanup:
- FollowerAI properly resumes follow after evading.
- Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing
- FollowerAI properly assists in combat.
- FollowerAI properly despawns if quest is abandoned.
- FollowerAI now supports dynamic respawning for escort NPCs.

(cherry picked from commit 3d4bebd8d9)
2021-12-17 23:05:55 +01:00
Treeston
3388cea685 Core/Misc: Remove Trinity::Containers::Size (duplicate of advstd::size)
(cherry picked from commit f1d9a36c5f)
2021-12-17 21:57:41 +01:00
Treeston
eee950cdd7 Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime

(cherry picked from commit d60082ae86)
2021-12-16 01:33:09 +01:00
Treeston
d5e58cef69 Core/Spawns: Exterminate CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY with extreme prejudice. (It didn't work anyway.)
(cherry picked from commit 26440857c1)
2021-12-16 01:18:15 +01:00
Treeston
be05590a12 Core/DB: Unify creature_respawn and gameobject_respawn into a single respawn table
(cherry picked from commit 374597c8e9)
2021-12-16 01:10:06 +01:00
ccrs
16bbc015e7 Core/Weather: 6eecb68 followup
missing IntervalTimer::Update call

(cherry picked from commit 965ec9a571)
2021-12-15 00:17:33 +01:00
Treeston
2532de6acb Entities/Unit: Nuke Map::ForceRespawn from orbit, with the following implications:
- .npc respawn no longer causes stupid things to happen (Fixes #23014)
- ::DeleteFromDB methods on Creature and GameObject rewritten to be as sensible as such a colossally stupid method can ever be. They're static now.
- .npc delete and .gobj delete ported to new argument handling, and rewritten as per above. They can no longer crash the server when used in instances, too. Yay for that.
- Adjusted various dusty cobwebbed hacks around the core (why does waypoint visualization use permanent spawns *shudder*) to still work too.

(cherry picked from commit 84b7b2e08e)
2021-12-14 22:42:22 +01:00
Treeston
2225cb1201 Entities/Creature: Some asserts are now LOG_ERRORs that block spawning. Fix a group spawning bug exposed by the CoS merge. Improve some command output.
(cherry picked from commit ded18a2690)
2021-12-14 22:24:24 +01:00
ccrs
6a63200e40 Core/Instance: add new hook & method
(cherry picked from commit 953b05459a)
2021-12-13 00:42:18 +01:00
Jeremy
4fcc4a3300 Core/Movement: Fix some undermap issues with random movement/fear/blink (#22937)
* Core/Movement:
- Only move to point if there is a path that is not a shortcut (which will make the unit move through terrain)
- Added new function to check if there is a vmap floor without search distance
- Units that can fly, are underground but far above the vmap floor will stay underground (bronze drakes in tanaris)
- Don't remove PATHFIND_SHORTCUT from path type in some cases

* Core/Object: Ignore UpdateAllowedPositionZ for flying units.

- This will make flying units go through mountains instead of going to the top and back to the bottom to reach you.

* Core/Object: Revert some changes and let MovePositionToFirstCollision deal with a position without ground

* Missing groundZ change for objects on transport

* use CanFly instead of IsFlying

(cherry picked from commit 9fcbd8f15d)
2021-11-26 22:43:48 +01:00
Aokromes
49e1ff34b7 Core/mmaps: add category to 2 logs
(cherry picked from commit a2f910fe5c)
2021-11-23 23:44:00 +01:00
Giacomo Pozzoni
d5c41d23e6 Core/Misc: Log more information in asserts (#22783)
* 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 9a924fb9d5)
2021-11-16 20:36:58 +01:00
Treeston
19f24b3e40 Core/Maps: Fix a crash when spawning a spawn group
(cherry picked from commit 969436adfe)
2021-10-23 16:00:28 +02:00
Treeston
48ce1965ba visibility range check, fac4700 follow-up
(cherry picked from commit b7c0f1961c)
2021-10-17 01:30:05 +02:00
Treeston
f7e5931b49 Core/Maps: Continue updating creatures that own auras applied to players. Closes #22110.
(cherry picked from commit fac470014b)
2021-10-17 01:11:51 +02:00
ModoX
68c2fc8ff5 Core/Characters: Made homebind location a WorldLocation (this implicitly adds orientation) (#27055) 2021-10-16 01:17:47 +02:00
Shauren
d7302ffd14 Core/Scenes: Implemented spell created SceneObjects 2021-10-11 12:59:19 +02:00
Shauren
2d7af28e9f Core/Transports: Store information about continent transports 2021-10-02 19:59:56 +02:00
ccrs
426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96)
2021-09-28 00:15:13 +02:00
Shauren
453b59de57 Core/Maps: Adjusted logic in GetFullTerrainStatusForPosition to closer match what the client does regarding being inside WMOs
Closes #21625
Closes #21624
Closes #21516

(cherry picked from commit b9c6bbb51d)
2021-09-25 01:04:21 +02:00
ariel-
65dca120d3 Core/Spells: rework part 4: iterate over effects first
Ref #18395

Implement far spell queue processing
Closes #7395

(cherry picked from commit 080d2c6cd4)
2021-08-28 15:59:11 +02:00
Shauren
2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065b)
2021-08-24 12:44:38 +02:00
Jeremy
43b944bf92 Core/Maps: Fixed outdoors check (#21551)
(cherry picked from commit 367db4e1d6)
2021-08-22 21:09:18 +02:00
Treeston
552ce7c286 Core/VMap: Use fuzzy equality and gridmap tolerance for floor-finding. Closes #21338. Supersedes #21479.
(cherry picked from commit ec916db294)
2021-08-08 21:21:34 +02:00
Treeston
e47e95b6dc Core/VMap: Add outdoor state to Map::GetFullTerrainStatusForPosition. Add WorldObject::IsOutdoors, basic member access.
Ref #21479.

(cherry picked from commit e79c595b69)
2021-08-08 21:21:34 +02:00
Treeston
5c80f50734 Core/Spawning: Actually check spawn group state before processing a respawn. It feels like that is something that should've been noticed at some point.
Also remove CreatureScript::CanSpawn since nobody uses it, and spawn groups do the same thing.

(cherry picked from commit 94b5d9bfa1)
2021-08-08 21:21:34 +02:00
Treeston
7db3f7ca96 DB/SpawnGroup: Instance spawn group data for Tempest Keep: The Eye and Hellfire Citadel: Ramparts.
(also some minor adjustments to command output for convenience)

(cherry picked from commit 51e28ae76a)
2021-06-16 23:01:48 +02:00
Shauren
8aaf750be1 Core/Conditions: Implemented missing PlayerCondition columns - time and weather 2021-06-04 21:47:43 +02:00
Shauren
6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Treeston
8b7728f82e Core/Map: New Map::ForceRespawn to override objections and force a respawn (equivalent to force = true). Use this to fix various GM commands.
Scripts/Valithria: Fix an issue that could get the encounter stuck in an unloaded state.

(cherry picked from commit 3bb33e3108)
2021-05-16 21:56:06 +02:00
Treeston
b00d3812ab Core/Map: Fix a crash that could happen if a player moved very far away from a creature they were in combat with. Closes #21177.
(cherry picked from commit e0b609a178)
2021-05-16 21:56:05 +02:00