Commit Graph

184 Commits

Author SHA1 Message Date
Vincent-Michael 20ab76a2cb Core: Whitespace cleanup 2015-04-08 02:27:20 +02:00
Daniel M. Weeks 8476c2ac5a Switch abs to std::abs 2015-04-02 22:28:13 -04:00
Daniel M. Weeks b948a4275e Add missing override keyword in scripts 2015-04-02 22:28:05 -04:00
Rushor 7086231a03 Scripts/Arcatraz: Harbinger Skyriss Adds - Remove Unattackable Flag on Spawn
(cherry picked from commit a99d57b0a3)
2015-03-07 17:55:37 +01:00
Rushor 93236fdda4 Scripts/Arcatraz: Warden Mellichar - Set summoned Units in Combat
(cherry picked from commit 1e90b096ca)
2015-02-18 18:15:36 +01:00
Nayd 802725817b Core/Packets: Update and enable CMSG_STAND_STATE_CHANGE and SMSG_STAND_STATE_UPDATE 2015-01-28 19:29:31 +00:00
Vincent-Michael ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
Rat ce5b683a07 Core/Spells: fixed Script project building 2014-11-28 14:00:50 +01:00
Shauren 9cc7044546 Core/Entities: First batch of removing implicit conversions of ObjectGuid to uint64 2014-10-21 19:23:32 +02:00
jackpoz 79b9ca4a58 Scripts/Misc: Make InstanceScript::Initialize() obsolete
Move all InstanceScript initialization code from Initialize() to the constructor.
InstanceScript::Initialize() is now obsolete, please don't use it anymore. The only reason it's still in the sources is for backward compatibility.
2014-09-25 22:28:20 +02:00
jackpoz 6e27841382 Core/Misc: Refactor scripts to fix static analysis warnings
Seventh batch of fixes targeting 100 issues reported by Coverity
2014-09-21 22:15:04 +02:00
Shauren 9b316fe689 Core/Scripts: Fixed PCH build 2014-09-16 00:44:56 +02:00
Shauren a3d8f1d879 Core/Scripts: Fixed build of boss_* scripts 2014-09-15 22:07:11 +02:00
Shauren 56f46e3ce5 Scripts
* Introduced GetGuidData/SetGuidData to store guids in instance scripts (GetData64/SetData64 are still there)
* CONDITION_INSTANCE_INFO: Changed existing DATA64 condition to GUID_DATA to preserve current use of this instance info type (most/all assume the data is a guid) and moved DATA64 to a different value - no db changes needed
* Fixed compile in boss scripts starting with letter A
2014-09-14 23:23:23 +02:00
Shauren ce67a097bf Core/Entities: Use new PackedGuid class 2014-09-13 01:12:16 +02:00
joschiwald ef9b4aea5e Core/InstanceScript: refactored load and save methods 2014-09-07 00:42:14 +02:00
joschiwald bc42c48d97 DB/Spells: added a few spells to spelldifficulty_dbc 2014-08-26 04:35:37 +02:00
jackpoz 7fe7f30521 Core/Misc: Fix some -Wconversion warnings 2014-08-23 19:56:41 +02:00
jackpoz 8402570bb8 Scripts/Misc: Fix static analysis issues
Replace CAST_AI() macro with ENSURE_AI() when dynamic_cast is not supposed to return NULL.
2014-08-09 00:12:20 +02:00
jackpoz 3388587b7a Core/Misc: Replace rand() calls with SFMT 2014-07-22 21:43:19 +02:00
Gacko 8ef34535a4 Scripts: Remove unused variables (kept as comment) 2014-06-01 19:34:34 +02:00
jackpoz 1083dbb993 Core/Misc: Remove Unit::Get* wrappers for ObjectAccessor::Get* 2014-05-20 21:21:33 +02:00
Shauren f9c7bb4171 Partially revert f296095191 "Fix various warnings. The core, the scripts and the tools now compile without warnings with -Wall -Wextra -pedantic."
Visual studio does not support constexpr
Made semicolon after "Prepare*Script" mandatory - workaround for dumb IDEs inserting extra indentation level after newline
2014-05-18 12:50:10 +02:00
Praetonus f296095191 Fix various warnings. The core, the scripts and the tools now compile without warnings with -Wall -Wextra -pedantic.
-Fix warnings from -Woverflow on implicit constant conversion.
-Fix warnings from -pedantic.
-Fix warnings from -pedantic.
-Fix warnings from -Wformat.

Two minor changes in addition :

-Replace a defined value equal to 2^31 - 1 by std::numeric_limits<int>::max().
-Remove useless null-check on pointer returned by new. New doesn't returns nullptr on failure, it throws std::bad_alloc.
2014-05-15 21:32:47 +02:00
Dehravor 24ae6a6802 Core/Misc: Remove obsolete C++11 backward compatibility macros
OVERRIDE, FINAL, DELETE_MEMBER
2014-04-29 16:35:11 +02:00
jackpoz 2585e799f9 Core/Misc: Change how Position struct is retrieved
Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bcaf9 changes by return a Position object instead of accepting a Position parameter by reference.
2014-04-25 21:19:30 +02:00
jackpoz fb6365ac68 Core/Misc: Check GetVictim() for NULL before dereferencing it
Add additional NULL checks all around the code before dereferencing GetVictim() result.
Keep in mind UpdateVictim() result has nothing to do with GetVictim() result and the caller shouldn't assume anything about GetVictim() based on UpdateVictim().
2014-04-20 00:38:25 +02:00
jackpoz 8ca6371793 Core/Misc: Ensure GetVictim() returns a valid reference when expected
Add a new method EnsureVictim() which asserts a valid not NULL reference will be returned to the caller. Use this whenever the GetVictim() would be dereferenced .
2014-04-19 21:48:22 +02:00
jackpoz 0930482fa4 Core/Misc: Fix uninitialized values
Fix Position members not being always initialized.
Valgrind log:
 at : Position::NormalizeOrientation(float) (Object.h:388)
 by : Position::SetOrientation(float) (Object.h:315)
 by : Position::Relocate(Position const&) (Object.h:310)
 by : spell_ulduar_stone_grip::spell_ulduar_stone_grip_AuraScript::OnRemoveVehicle(AuraEffect const*, AuraEffectHandleModes) (boss_kologarn.cpp:592)
2014-04-02 20:42:46 +02:00
Vincent-Michael 0b615ec159 Scripts/Misc: Small code optimizations 2014-03-29 20:58:49 +01:00
jackpoz 8c44259fae Core/Misc: Fix some static analysis issues
Fix uninitialized values, most of which are false positives, always initialized before being accessed.
Add some asserts and additional NULL checks as sanity checks. Use SpellMgr::EnsureSpellInfo() if the spell id is valid and always supposed to return a valid not-NULL SpellInfo* .
2014-03-27 21:43:59 +01:00
jackpoz 6dcd8c8545 Core/Misc: Fix some static analysis issues
Fix some static analysis issues about:
- uninitialized values, most of which are false positives, always initialized before being accessed
- unchecked return values
- dead code never executed
- bad formatting leading to wrong behavior

Please ensure EventMap is never used with event id set to 0 or those events will never execute.
2014-03-22 14:54:32 +01:00
Vincent_Michael 46e1b93c2b Scripts: A lots of changes here and there (maybe useless?!?) 2014-01-23 22:54:01 +01:00
Vincent_Michael 20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
jackpoz 64b42c75d2 Scripts/Misc: Code cleanup
Remove some NULL checks not needed anymore after 3744c14184 .
Fix an invalid Creature to TempSummon cast.
2013-12-30 23:36:49 +01:00
jackpoz 3744c14184 Scripts/Misc: Ensure Creatures are in instances when required
Create ScriptedAIs that require a InstanceScript reference only if the InstanceScript exists, so if these Creatures are in an instance. ScriptedAIs that don't require a InstanceScript reference have not been modified.
This fixes many possible NULL dereference crashes happening when spawning a scripted Creature outside of an instance.
Fixed a GetOwner() and a ToPlayer() NULL dereference crashes too.
2013-12-29 01:19:52 +01:00
Malcrom fe95371d9a Core/Scripting: Replace casted with cast as casted is not a word. 2013-12-25 14:16:55 -03:30
joschiwald fd6167cf66 Scripts:
- cleanup obsidian sanctum script
- prevent yelling texts if non player died in some scripts
2013-12-23 23:55:15 +01:00
Shauren 107af52853 Core/Chat: Refactored building chat packets
* Moved everything into one specialized method instead of being scattered all over the place
* Allow localizing creature names in chat messages (when using $N)
* Send SMSG_GM_MESSAGECHAT for gm messages
2013-12-23 14:23:49 +01:00
joschiwald dd16bfb881 Scripts/Oculus: fix drake spells
Closes #6681
Closes #6680
Closes #6673
2013-12-05 00:00:07 +01:00
joschiwald 6a7067f766 Scripts: fix some issues found by static code analysis (also fix 2 startup errors) 2013-11-28 20:19:57 +01:00
joschiwald 00d5c59f5b Scripts/Arcatraz: cleanup InstanceScript to make it work with BossAI 2013-11-26 15:38:02 +01:00
joschiwald 0790138d73 Core. fix build and some codestyle changes 2013-11-13 23:32:38 +01:00
Malcrom c2db6d49ce Scripting/The Arcatraz: Add text scripting for deaths 2013-11-10 10:00:47 -03:30
Malcrom e5b259fb4a Scripting/Arcatraz: Move Zereketh the Unbound, Dalliah the Doomsayer, & Wrath-Scryer Soccothrates to cpp scripting and some cleanup. 2013-11-10 03:22:22 -03:30
Spp 94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
Ascathor 2607738990 Core/Code: Unify codestyle for brackets: {} to { }.
Also added missing copyright to some files.
2013-10-27 23:46:02 +01:00
Vincent_Michael 9802c7b891 Scripts/Misc: Coding Style unification? (by Aokromes) 2013-10-22 20:24:05 +02:00
Vincent-Michael da1e466bd5 Core/Misc: Implemented GetObjectScale function 2013-08-17 23:47:43 +02:00
Vincent-Michael 8acefbff8c Scripted: Use now override for instance scripts 2013-08-10 17:42:12 +02:00