Commit Graph
551 Commits
Author SHA1 Message Date
Ovahlord b8e1de0f92 Core/Objects: use the static vmap check in MovePositionToFirstCollision for all path results to avoid falling below wmo surfaces when the mmap path returns unreliable data
(cherry picked from commit a548d9f9b021a54cfc9013b7e104ccf524e88358)
2022-01-01 23:49:31 +01:00
Ovah 26e7da1622 Core/Objects: further improvements for MovePositionToFirstCollision (#24523)
* Core/Objects: further improvements for MovePositionToFirstCollision

* the PathGenerator will now normalize incomplete destinations as well
* normalize destination positions before launching detour raycasts to get better direction data
* exclude unwanted pathfinding results from further use to avoid unintended behaivior

* Core/PathFinding: Split PATHFIND_FARFROMPOLY into PATHFIND_FARFROMPOLY_START and PATHFIND_FARFROMPOLY_END for start and end position

Handle PATHFIND_FARFROMPOLY_END as valid in MovePositionToFirstCollision

Co-authored-by: jackpoz <[email protected]>
(cherry picked from commit 6485422c6127262855b3c90183388e29dc251de5)
2022-01-01 23:30:48 +01:00
Ovahlord b8805f4389 Core/Objects: optimize and improve MovePositionToFirstCollision results
* removed redundant static LOS checks as they are covered by the mmap raycast prior to the check
* removed unnecessary VMap height lookups to determine rapid falloffs as they are covered by the mmap raycast as well

(cherry picked from commit cf849df50af0e930b08c0fa3cd1bb4426be9c69a)
2022-01-01 23:19:31 +01:00
Rushor db825c3221 Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT (#24494)
* Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT which allows to search for closest unspawned gameobjects

* updates: https://github.com/TrinityCore/TrinityCore/issues/24067

* Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT which allows to search for closest unspawned gameobjects

(cherry picked from commit 2d948d33666fbd6f82145c4629483753b7780bb5)
2022-01-01 21:33:34 +01:00
Gildor 60e66621da Core/Gameobjects: Improve stealth detection (#24417)
* Core/Gameobjects: Improve stealth detection

* fix warning: private field 'i_funit' is not used

* Code cleanup

* add comment

Co-authored-by: jackpoz <[email protected]>
(cherry picked from commit 862097a63351e957fd4aa6cb82fe7d9edf4d3926)
2022-01-01 15:05:01 +01:00
Ovah d18d2b84f2 Core/Objects: cache current liquid status of objects when updating position data and use it to replace unnecessary vmap lookups (#24399)
* dropped unneeded IsUnderwater override for players since the default position data update considers collision height already so we don't have to rely on that tempfix anymore. This actually fixes breathing bars showing up depending on your characters size (gnomes get their breathing bar earlier, taurens later etc)

(cherry picked from commit bea850fb73c6c3b3cc4e51bd3a42d178947882a5)
2022-01-01 12:42:17 +01:00
Giacomo Pozzoni a9e325f6b7 Core/Logs: Log full guid instead of just low guid, part 2
(cherry picked from commit 3def52c1c459f566ab2b2d8cf017c70df4d7cf22)
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 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e)
2021-12-31 21:56:40 +01:00
Matan Shukry a3d06f2f32 Scripts/Spells: Implemented various rogue spells (#26319)
* Ruthlessness
* Mastery: Main Gauche
* Venomous Wounds
* Symbols of Death
* Backstab
* Premeditation
* Grand Melee
* True Bearing
* Slice and Dice
* Roll the Bones
2021-12-25 21:25:54 +01:00
Shauren 48bd9698f8 Core/PacketIO: Fixed SMSG_UPDATE_OBJECT packets going missing for new items
Closes #16906

(cherry picked from commit 96155a49147f6119e8bd9bc08936ab706173b67e)
2021-12-24 00:44:23 +01:00
Giacomo Pozzoni 6770987d6f Core/Objects: MovePositonToFirstCollision will now use detour raycasts to determine terrain obstacles (#24232)
* Core/Objects: MovePositonToFirstCollision will now use detour raycasts to determine terrain obstacles

* Added missing includes

* Update Object.cpp

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit d1080af8db63c78986a7fcc94fcfb2fdfe817734)
2021-12-22 21:44:01 +01:00
Killyana 89edc84c23 Core/Log: Gameobjects may have faction template id = 0
Ref https://github.com/TrinityCore/TrinityCore/pull/22922

(cherry picked from commit 8b03fe95061f870efbe5352530c25a0175c4d8ee)
2021-12-19 01:36:54 +01:00
Aokromes 3ad5bc1e15 Core/Misc: More coding standards (#23519)
* Core/Misc: More coding standards

* revert part

* "void  " or more to "void "

* fix? reject

* remove more double whitespaces

* remove more double whitespaces

* more standards

* more coding standards

* More standards

* more coding

* more coding standards

* more coding standards

* And more standards

(cherry picked from commit 574a7c8d3d5f5a5660295deb70e905cf4dd756c4)
2021-12-14 23:04:29 +01:00
ccrs 4e6c59dca7 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()

(cherry picked from commit 5c09ff51f7015b775def8d5cc1f678eaef37200f)
2021-12-13 00:42:20 +01:00
Aokromes 30cec73c61 Coding standards (#23514)
* Coding standards

* revert part

(cherry picked from commit fe744977c917957e112704ccd66e228b826b3f7a)
2021-12-13 00:42:17 +01:00
Shauren 54f607641a Core/Spells: Moved SpellVisual functions from Unit to WorldObject 2021-12-12 19:34:00 +01:00
Giacomo Pozzoni 5f545f5402 3.3.5 gameobject summoner (#23289)
* 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)
2021-12-07 00:02:03 +01:00
jackpoz 7fc359559f Core/Misc: Fix static analysis issues reported by Coverity
(cherry picked from commit a0bd68cf465517786d16bcb145ed3fc8bc5b5b98)
2021-12-05 22:44:38 +01:00
brotalnia ab988dc982 Core/Spells: Return CheckCast result from CastSpell (#23236)
* Return CheckCast result from CastSpell

* Return cast result from UnitAI methods too.

(cherry picked from commit 49d0a5bbb69dd352bac0009625ded2c472b66805)
2021-12-05 14:37:13 +01:00
Shauren 7e779a6f59 Core/Units: Send PlayHoverAnim state in CreateObject if enabled by Unit::SetPlayHoverAnim 2021-12-04 12:45:46 +01:00
ccrs 1ba002ef3d Core/Object: re-change faction template related logs
(cherry picked from commit dfa54d3bf41897dbdfc0acf42f39b173dd39e857)
2021-12-02 00:39:28 +01:00
ccrs 356358ee15 Core/Misc: standarize a couple logs
(cherry picked from commit aee26eb46727171593ef7cc1d2652a7847dc88fc)
2021-12-02 00:39:28 +01:00
jackpoz dd825c5614 Core/Maps: Fix crash caused by setActive(false) called after DespawnOrUnsummon()
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)
2021-12-02 00:39:20 +01:00
Jozef Dúc b717603a9b Core/Object: Range check (#23179)
* Should solve #23062. All credits to @xvwyh

* Remove unused variables

* Remove unused variable

* Cast int32 to uint32

* Remove G3D headers from core header file

* Change door distance

* Update GameObject.cpp

Add newline

* Update GameObject.h

Indentation

(cherry picked from commit 32e1de39a26628dcb64bc21ad415afb2ad938925)
2021-12-02 00:39:20 +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 9fcbd8f15d249070aabc25d48df86681e8ec3d11)
2021-11-26 22:43:48 +01:00
Ovah d5daa2ad49 Core/Objects: use the actual collision height of players and creatures to get more accurate liquid status results (#23070)
(cherry picked from commit b9e9ccf93c63c3b27d7a6f9eced0beb4e14af40e)
2021-11-26 22:24:07 +01:00
Shauren 7a413ae543 Core/Spells: Fixed spells using MovePositionToFirstCollision for selecting target position getting Z coord offset by caster or target collision height (depending on spell target type)
(cherry picked from commit d63d15c505708d175c52d87afc76cbe4ac59497b)
2021-11-23 23:16:49 +01:00
Aokromes c5720e37c1 Core/Entities: Add categories to 2 logs
Closes #22922

(cherry picked from commit 578c796625859656b788565378250f783a348b09)
2021-11-23 22:28:38 +01:00
Shauren f24e16a460 Core/Spells: Fixed crash with some gameobject spell casters
(cherry picked from commit 755133d8609c424c49be4bbe3bb4ec1ed02195f8)
2021-11-18 23:03:14 +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 9a924fb9d557434c5a2e4020c80db6e6bfe466ad)
2021-11-16 20:36:58 +01:00
Meji a832435b97 Core/Spells: Implemented SummonPropertiesFlags: UseSummonerFaction & IgnoreSummonerPhase (#27273) 2021-11-16 11:51:05 +01:00
Ovah 234a680d3a Core/Objects: properly use UPDATETYPE_CREATE_OBJECT2 when creating brand new objects in all cases. Closes #22419 (#22816)
(cherry picked from commit fb1d568fbaedb2198ee6a39aac669533d8924c82)
2021-11-15 23:42:22 +01:00
Treeston 7c062db94b Core/Player: Clean up duel related code. Fix a check for abusive client behavior, sanitize pointer usage, code style. Closes #22374.
(cherry picked from commit 003cc56d70c9b07f4484cb82484091ab4013895a)
2021-11-08 23:49:15 +01:00
Shauren 5c8a058120 Core/PacketIO: 9.1.5 updatefields and SMSG_UPDATE_OBJECT structure 2021-11-04 21:47:03 +01:00
Shauren b13e9f9d61 Core/Misc: Fixed clang 13 warnings, gcc 11 build errors and nopch build 2021-10-25 00:05:05 +02:00
Treeston 8760b7322e Core/Spells: Clean up some assist checks (no behavior change)
(cherry picked from commit 83ee145736a39ac1ce8305947f188aeaa13c7b04)
2021-10-23 14:49:43 +02:00
Treeston d81a74bc98 Core/Spells: Fix an incorrect check that was exempting negative spells from _IMMUNE_TO_x checks. Closes #21929.
(cherry picked from commit 75e7404bba8c68e534ae3216787e424c4f0cb337)
2021-10-23 14:46:53 +02:00
Meji 11cc5c0d3b Core/BattlePets: Misc fixes (#27057)
* Rename WorldPackets::BattlePet::BattlePet::CollarID to WorldPackets::BattlePet::BattlePet::DisplayID
* Use the DisplayID field to store the model of the battle pet. If the species has BattlePetSpeciesFlags::RandomDisplay, nothing is stored. Otherwise a random model is chosen from those available
* Stored DisplayID in ITEM_MODIFIER_BATTLE_PET_DISPLAY_ID when caging the battle pet (previously the CreatureID was being stored)
* Modified SendPlaySpellVisual function to allow sending Target and TargetPosition at the same time
* Added SpellVisual when uncaging
2021-10-16 12:15:03 +02:00
Shauren d7302ffd14 Core/Scenes: Implemented spell created SceneObjects 2021-10-11 12:59:19 +02:00
killerwife de326d789e Core/Unit: Name and implement UNIT_FLAG_NON_ATTACKABLE_2 (PR #22087)
(cherry picked from commit 16f524ff2537646417d1150ef3bdab8e4cc8a2b1)
2021-10-07 21:25:57 +02:00
Shauren 6d93f0a5f7 Core/Scenes: Delay scenes sent when not in world until adding to map 2021-10-05 15:10:33 +02:00
Shauren cbf1f2883a Core/Spells: Reduce number of CastSpell overloads to 1 2021-10-03 19:58:03 +02:00
Shauren 555b2d40ec Core/Spells: Send OriginalCastId in SMSG_SPELL_START and SMSG_SPELL_GO for triggered spells in 'game' project 2021-10-03 16:36:39 +02:00
Shauren 2d7af28e9f Core/Transports: Store information about continent transports 2021-10-02 19:59:56 +02:00
Treeston f1ac141f25 Core/Unit: UNIT_FLAG renames
[UNIT_FLAG_PLAYER_CONTROLLED -> UNIT_FLAG_POSSESSED]
[UNIT_FLAG_PVP_ATTACKABLE -> UNIT_FLAG_PLAYER_CONTROLLED]
Signed off by: Shauren, Warlockbugs.

(cherry picked from commit 081eab3cf5a5ec42917b2a7eaebf816fb36da423)
2021-09-26 16:07:09 +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 b9c6bbb51df0ed10f74617482740fedb91ff5366)
2021-09-25 01:04:21 +02:00
Keader 69663cc94f Core/Spells: Fix UNIT_CREATED_BY_SPELL in SPELL_EFFECT_SUMMON (#21756)
(cherry picked from commit 309738dc3e08f572fad661e96f149a017011758c)
2021-09-23 23:50:13 +02:00
Treeston fc05aba0d4 crash fix follow-up
(cherry picked from commit 6939f4eb7b023a6b2f8940ab12484523e1904860)
2021-09-23 22:28:48 +02:00
Treeston f69d12504c Core/Object: Bump hover delta handling on nearpoints downstack into GetNearPoint2D (from movement generators); functionality should be unchanged
(cherry picked from commit ebc96af6bb784819ba8824ac390864ae9ba12351)
2021-09-23 22:28:06 +02:00
Treeston bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2ffed5ba2a0336e9c93962b0fad9eaa)
2021-09-23 22:21:29 +02:00