Commit Graph
518 Commits
Author SHA1 Message Date
jackpoz 7fc359559f Core/Misc: Fix static analysis issues reported by Coverity
(cherry picked from commit a0bd68cf465517786d16bcb145ed3fc8bc5b5b98)
2021-12-05 22:44:38 +01:00
Jozef Dúc a13a765610 Core/Object: Range check vol. 2 (#23226)
* Core/Object: Fix all missing parts for #23062

* Update GameObject.cpp

(cherry picked from commit 78070163dc6b9bb34ab2d006e9cc218548e861b7)
2021-12-03 00:21:19 +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
jackpoz 73c6c13ace Core/GameObject: Code cleanup
(cherry picked from commit 16a154c4e87ff1ff89323a8960bf601e6c18589b)
2021-12-02 00:39:20 +01:00
Killyana a18808212e Core/GameObject: Remove summoned gobs properly from the map without effecting other cases
Ref https://github.com/TrinityCore/TrinityCore/commit/0e8e3828f48120629b642d0de1db704fd0bb86cb
Ref #23115

(cherry picked from commit 9db64666dc30b1f8cad904bf8aeea1c9daf41c95)
2021-12-02 00:39:20 +01:00
Killyana 62d3010e56 Core/GameObject: Delete summoned gobs and DestroyForNearbyPlayers gobs spawned with negative spawn time once the gob is deactivated
(cherry picked from commit 0e8e3828f48120629b642d0de1db704fd0bb86cb)
(cherry picked from commit 65afe47580e84a006eb6ce506623d3719ae5bc9b)
(cherry picked from commit 21667f97cbd519dbef1650cd29d53f26443441f3)
2021-12-02 00:39:19 +01:00
jackpoz b02143118f Core/Database: Delete gameobject_addon data when deleting a GameObject from the database
Close #23076

(cherry picked from commit f88a5b12bd7511331ea27975fe26bfc98d92d20d)
2021-11-30 23:05:27 +01:00
jackpoz 43a41caafb Core/Misc: Fix GCC 8 warnings
(cherry picked from commit 1d04a3b216901671eae0104547715a570b1ff3ab)
2021-11-24 23:40:15 +01:00
sirikfoll dc5cab3bf4 Core/GameObject: Properly dismount players on GameObject Use
Closes #23124

(cherry picked from commit dbfc6ce773afad4b5a4db77cbb76e64755d3ef94)
2021-11-24 23:34:48 +01:00
Killyana a99a60bcf3 Core/GameObject: Remove summoned game objects from the map after calling SetSpawnedByDefault(false) (#23120)
Closes #23115

(cherry picked from commit 5f04c829a861da7d5a4f0ac955d6c1fbcd917af9)
2021-11-24 22:27:03 +01:00
Killyana 8d806f8c69 SAI/GameObject: Despawn the linked trap with the gameobject
Closes #23105

(cherry picked from commit 750be73b9963ebcd4b823ec88b20af7cd819529b)
2021-11-24 21:22:50 +01:00
Killyana b0f10b505e Core/GameObject: Set loot state to Not ready when a gob is deactivated (#23072)
(cherry picked from commit 8dec9b97e211d9b9d5153a3f0d19097bae6fdeff)
2021-11-24 20:34:56 +01:00
Jeremy 2a9940e17d Core/GameObject: Implement GameObject::Use case for GAMEOBJECT_TYPE_NEW_FLAG (#27267) 2021-11-20 20:36:56 +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
Rochet2 afac2b1742 Add rotation to .gob info (#22723)
* Add rotation to .gob info

- Add rotation (yaw, pitch, roll) to .gob info command
- Replace LANG_SPAWNINFO_DISTANCEFROMPLAYER with LANG_SPAWNINFO_ROTATION
- Fix description of .distance to describe the command arguments (the more you know..)
- Fix .gob info guid targetting nearest gameobject instead of finding with given guid
- Reorder the info data slightly
- Print location and rotation data regardless of object found in world
- Add error messages for when object is not found by guid or entry

(cherry picked from commit 257ae44a20ed40469dd821845de8e27c0af838c7)
2021-11-15 21:49:37 +01:00
jackpoz b6f28a7ebc Core/Packets: Reduce memory footprint of cached queries (#22297)
Ensure only the minimum required memory is used by caching query packets by calling shrink_to_fit()

(cherry picked from commit deabd4ab453ee8cf1f515bdb32bf9cf9de7f0591)
2021-10-22 23:15:27 +02:00
PolarCookie 8c9e5cd3f3 [3.3.5] Core/Loot/Gameobject: Tempspawned Gameobjects after looting (#22124)
* spell spawned chest non-despawn fix

* fix the consumed game objects

(cherry picked from commit 97371533bf4fa0664957b2badf2c945b5b7595c2)
2021-10-22 21:39:28 +02:00
Treeston eb7a8584e2 Core/GameObject: Fix an edge case where GOs might never respawn after being manually despawned. Closes #21792.
(cherry picked from commit 9c5fffb4c51fb53a105b20c97eab19e2ff252788)
2021-10-14 19:40:05 +02:00
Treeston 3418a33a87 Misc: Pass std::chrono types by value everywhere.
(cherry picked from commit 2ef9d301f0869b443122e2ba543af054c5b0e53c)
2021-10-14 19:39:42 +02:00
Maphaze 22298fb172 Core/GameObjects: Fixed DestroyGate battleground hook for vehicles (#22145)
(cherry picked from commit 2ef33158486831aa061050f5cc7d316fee17721d)
2021-10-14 00:11:29 +02:00
Shauren 5274f7af17 Core/PacketIO: Added missing move assignment operator to ByteBuffer
(cherry picked from commit fcb1e3e6424ef86934132e1111052a6798d78bc9)
2021-09-26 01:27:59 +02:00
Meji 0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
Killyana ffae92edd2 Core/GameObject: Fix linked traps not being despawned properly and remove deprecated code
Closes #20159

(cherry picked from commit 8f0af67bcb56712d4c333f36a1c2030443c10fb7)
2021-09-06 15:26:50 +02:00
ariel- 962f6d7988 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d63796d168339a44f63418f220cf2403)
2021-08-28 15:59:11 +02:00
ariel- 67a1a1d29b Core/GameObject: implemented gameobject_overrides table to change faction and flags values on a per-spawn basis
Updates #20957
Closes #20958

(cherry picked from commit 34967e9c32b2c7e871bb93f41609a3b08ad92931)
2021-08-08 21:21:34 +02:00
Treeston 65b8dafb53 Core/GameObject: Force compatibility mode for stupid ridiculous junk legacy hack gameobjects, ref 27e7906.
(cherry picked from commit 9f92896c52dfdaaad3a7eb66a780a7415dc12546)
2021-08-08 21:21:34 +02:00
Treeston de3eb7b298 Core/GameObject: fix stupid ridiculous junk legacy hack code with negative gobj respawn time to work again
(cherry picked from commit 27e7906814f2696863f5ab0488c59ffa347d8cc9)
2021-08-08 21:21:34 +02:00
Treeston 168be492f5 Entities/GO: Add forceRespawnTimer support to DespawnOrUnsummon. Use it in SAI.
(cherry picked from commit 264d4e1d30debcf6feacee3d29982875672a7bbe)
2021-06-20 22:10:08 +02:00
Treeston bccd81e12a Entities/GO: GameObjects now support (delayed) despawning in a reasonable manner. Closes #21406.
(cherry picked from commit f071fa9e931533c28e6b9d8b0e38ed8878ce2b45)
2021-06-20 21:49:11 +02:00
kelno 1206e815cd Core/Creature: improve DB linked_respawn handling (#21172)
* Fixed SetCreatureLinkedRespawn function possible erasing/replacing a GameObject link (instead of a creature one)

(cherry picked from commit 70eb18d0e58ecf0cfcda4f410a183c671fbafe5c)
2021-05-16 21:56:06 +02:00
Matan ShukryandShauren a8fa2a03be Core/Items: Calculating item level + organized iterating over items (#26276)
* Unified iterating player items into a single function

Co-authored-by: Shauren <[email protected]>
2021-04-21 10:02:42 +02:00
Treeston 9b141207d1 [3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation.

- CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments
- This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one
  - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object.
- A gajillion refactors to make everything behave the way it always has

(cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
2021-04-16 15:22:42 +02:00
jackpoz e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6c45eb105ad449eb9a56e76d84d691e)

 Conflicts:
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
	src/server/game/Battlefield/Battlefield.cpp
	src/server/game/Battlefield/Zones/BattlefieldWG.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Calendar/CalendarMgr.h
	src/server/game/DungeonFinding/LFGQueue.cpp
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Entities/Creature/Creature.cpp
	src/server/game/Entities/Item/Item.cpp
	src/server/game/Entities/Pet/Pet.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Grids/ObjectGridLoader.cpp
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/AuctionHouseHandler.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/CalendarHandler.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/ChatHandler.cpp
	src/server/game/Handlers/LFGHandler.cpp
	src/server/game/Handlers/MailHandler.cpp
	src/server/game/Handlers/MiscHandler.cpp
	src/server/game/Handlers/MovementHandler.cpp
	src/server/game/Handlers/PetHandler.cpp
	src/server/game/Handlers/QueryHandler.cpp
	src/server/game/Handlers/TicketHandler.cpp
	src/server/game/Instances/InstanceSaveMgr.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/Tickets/TicketMgr.cpp
	src/server/game/Tickets/TicketMgr.h
	src/server/game/World/World.cpp
	src/server/scripts/Commands/cs_gobject.cpp
	src/server/scripts/Commands/cs_instance.cpp
	src/server/scripts/Commands/cs_list.cpp
	src/server/scripts/Northrend/zone_wintergrasp.cpp
	src/server/scripts/Spells/spell_item.cpp
2021-04-15 05:53:27 +02:00
Matan Shukry 1082a6645e Core/Objects: Move personal summon handling from TemporarySummon/GameObject to WorldObject and check it using dedicated guid field 2021-03-28 20:22:05 +02:00
ariel- f199eac72c Core/GameObject: refactor dismounting on use
(cherry picked from commit 98236dfa8846aeea2643deaab5ca86b803e3aee7)
2021-03-15 20:17:31 +01:00
ariel- 0486ff8350 Core/GameObject: implement dismount on use of certain GOs
- The fact of player dismounting was entirely client-sided, with no server code enforcing it.

Closes #19979

(cherry picked from commit 2ce3f3a7b8c6c32c920fe45d27621da390cbc298)
2021-03-15 20:17:31 +01:00
Jeremy 2d84912ce9 Core/GameObjects: Add GameObjectPlaySpellVisual (#26044) 2021-03-14 15:40:42 +01:00
Osleyder Gonzalez Acosta 8ce9b69de3 Core/GameObjects: Allow setting GameObject anim kits in database (#25941)
Necessary to be able to see the new visual effects of the gameobjects such as the portals in the Portals Halls of Orgrimmar and Stormwind.
2021-01-25 23:17:20 +01:00
Matan Shukry e601c6d1f9 Core/Spells: Implemented summoning a personal gameobject effect (#25917) 2021-01-23 16:44:47 +01:00
Shauren 5f3a2d2abf Core/Quests: Fixed questgiver icons
Closes #25702
2020-12-11 22:19:19 +01:00
Shauren 364f6eec9a Core/GameObjects: Updated gameobject template structure to 9.0 2020-12-09 00:03:10 +01:00
Shauren f922c6e7a4 Core/PacketIO: Renamed a bunch of opcodes based on more research (only those added after 6.0) 2020-09-19 12:44:42 +02:00
Ovah ed79d904e0 Core/GameObjects: trigger npcs that are summoned for gameobject casting will now inherit their gameobject's phase shift as well 2020-09-11 16:30:21 +02:00
Shauren b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
r00ty-tc 03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0a35028779fd76372ae06cc98c8086f)
2020-08-22 12:59:57 +02:00
Treeston e6be53d141 Core/WorldObject: Properly initialize position data for all types when initially creating them. Fixes some issues with PvP objectives not having the correct area ID set on initialization. Closes #20028.
(cherry picked from commit 28b3469e89f89a8c87fad06bad27800939abf0f5)
2020-08-20 00:18:48 +02:00
treeston 2dfafa69eb Hi, I'm Treeston, and welcome to Combat PR Prep Refactors.
Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it.
New methods on Unit:
- void SetImmuneTo<All/PC/NPC>(apply, keepCombat = false);
- bool IsImmuneTo<All/PC/NPC>() const;

(cherry picked from commit 74af880217fc567c9949d7557408718af889402f)
2020-08-18 18:53:13 +02:00
Shauren 1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Shauren e3cf94d4fd Core/GameObjects: Properly set GO_FLAG_MAP_OBJECT during gameobject creation 2020-07-27 08:58:40 +02:00
ariel- 5903a10a83 Core/AI: segregate GameObject ReportUse from normal Use (lock open/normal click)
Closes #19819

(cherry picked from commit 2335b9de1a46a409c714a1dc89cbd0565545e70e)
2020-07-16 21:47:28 +02:00