Commit Graph

2259 Commits

Author SHA1 Message Date
Sebastian Valle
07d793b94b Core/Misc: Fixed some more issues found by static code analysis tools. 2013-09-03 17:31:02 -05:00
jackpoz
0450b74e96 Core/Movement: Fix uninitialized MovementInfo fields
Fix uninitialized fallTime and splineElevation fields of MovementInfo.

Valgrind log:
 Conditional jump or move depends on uninitialised value(s)
   at 0x5FBEB50: deflate (in /lib/x86_64-linux-gnu/libz.so.1.2.7)
   by 0x1269883: UpdateData::Compress(void*, unsigned int*, void*, int) (UpdateData.cpp:85)
   by 0x1269BB6: UpdateData::BuildPacket(WorldPacket*) (UpdateData.cpp:133)
   by 0x130E9B3: Trinity::VisibleNotifier::SendToSelf() (GridNotifiers.cpp:68)
   by 0x117A89D: Player::UpdateVisibilityForPlayer() (Player.cpp:22344)
   by 0x117B334: Player::SendInitialPacketsAfterAddToMap() (Player.cpp:22567)
   by 0x15A48BC: WorldSession::HandlePlayerLogin(LoginQueryHolder*) (CharacterHandler.cpp:937)
   by 0x141D04B: WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1106)
   by 0x141994D: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:391)
   by 0x14E289C: World::UpdateSessions(unsigned int) (World.cpp:2629)
   by 0x14E0613: World::Update(unsigned int) (World.cpp:1986)
   by 0x100B37F: WorldRunnable::run() (WorldRunnable.cpp:60)
 Uninitialised value was created by a heap allocation
   at 0x4C286E7: operator new(unsigned long) (vg_replace_malloc.c:287)
   by 0x159E64F: void LoadHelper<Creature>(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > const&, CoordPair<512u>&, GridRefManager<Creature>&, unsigned int&, Map*) (ObjectGridLoader.cpp:94)
   by 0x159DECF: ObjectGridLoader::Visit(GridRefManager<Creature>&) (ObjectGridLoader.cpp:150)
   by 0x159F092: void VisitorHelper<ObjectGridLoader, Creature>(ObjectGridLoader&, ContainerMapList<Creature>&) (TypeContainerVisitor.h:64)
   by 0x159EFF5: void VisitorHelper<ObjectGridLoader, Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > >(ObjectGridLoader&, ContainerMapList<TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > >&) (TypeContainerVisitor.h:70)
2013-09-03 23:05:02 +02:00
Shauren
f388ceb8bd Merge pull request #10687 from jackpoz/farsight_fix
Core/Spell: Fix farsight log error "Player requests non-existing seer"
2013-09-01 13:52:05 -07:00
jackpoz
1417f62453 Core/Spell: Fix farsight log error "Player requests non-existing seer"
Partially revert 167ca565d0 which wrongly used TYPEMASK_UNIT to denote Creatures and Players, so when a Player sent farsight opcode with another Player as target HandleFarSightOpcode() couldn't find the right Unit filtering by typemask TYPEMASK_SEER.
2013-09-01 22:35:48 +02:00
Shauren
e8a566b3b1 Core/Objects: Removed obsolete code 2013-09-01 22:30:07 +02:00
Nay
7ecf4fdec1 Core/Quests: Split Flags and SpecialFlags 2013-08-30 23:08:40 +02:00
Machiavelli
e3f27a36fe Core/Creatures: Fix base stats calculations for some cases.
i.e. health_mod of 0.001 resulting in hp of 0 instead of 1
2013-08-30 20:59:29 +01:00
Nay
7776016106 Core/Quests: Remove CastedCreatureOrGO method
- Remove EAI's ACTION_T_CAST_EVENT and ACTION_T_CAST_EVENT_ALL
- Remove SAI's SMART_ACTION_CALL_CASTEDCREATUREORGO
- Split QUEST_TRINITY_FLAGS_KILL_OR_CAST into QUEST_TRINITY_FLAGS_KILL and QUEST_TRINITY_FLAGS_CAST
- Assign QUEST_TRINITY_FLAGS_CAST to all the quests that were using RequiredSpellCastX
- (unrelated) Fix a warning in Player.cpp
- Replace CastedCreatureOrGO usage in scripts by KilledMonsterCredit

TODO: Convert the two EAI scripts commented out in the .sql to proper SAI

Closes #10667
2013-08-30 19:32:08 +01:00
Nay
62d1ee680b Core/Quests: Drop world.quest_template.RequiredSpellCastX
These were non-wdb fields that didn't have much use.
Most quests that were using these fields (not many) should still work,
however, if you find any quest that worked before and is now broken
please report it in the issue tracker and it will be promptly fixed.
2013-08-29 15:36:38 +01:00
Aokromes
2bd4a479a6 Core/Quests: Add repeatable quest rate to world.reputation_reward_rate 2013-08-28 14:52:23 +01:00
Nay
78786c7b54 Core&Scripts: Fix clang compiler warnings 2013-08-27 23:47:03 +01:00
Nay
cc14e18664 Core/Misc: Fix compiler warnings 2013-08-27 16:06:18 +01:00
Nay
8eaf763235 Core&Tools: Fix multiple issues found by a static code coverage tool 2013-08-26 02:00:18 +01:00
jackpoz
ee3d3ab1ff Core/Player: Fix uninitialized Player field.
m_MonthlyQuestChanged was initialized only when loading a Player from DB and left uninitialized when creating a new Player.

Valgrind log:
 Conditional jump or move depends on uninitialised value(s)
   at 0x1148E2A: Player::_SaveMonthlyQuestStatus(Trinity::AutoPtr<Transaction, ACE_Thread_Mutex>&) (Player.cpp:19694)
   by 0x1146510: Player::SaveToDB(bool) (Player.cpp:19191)
   by 0x14F5D5C: WorldSession::HandleCharCreateCallback(Trinity::AutoPtr<PreparedResultSet, ACE_Thread_Mutex>, CharacterCreateInfo*) (CharacterHandler.cpp:660)

Closes #10620

Signed-off-by: Nay <dnpd.dd@gmail.com>
2013-08-25 14:04:17 +01:00
Nay
12973de799 Core&Tools: Fix multiple issues found by a static code coverage tool 2013-08-24 22:57:22 +01:00
jackpoz
21459739c6 Fix uninitialized UpdateMask field
Initialized UpdateMask::_bits to NULL in all constructors.
UpdateMask(UpdateMask const& right) constructor sets the field count with SetCount() method before any field initialization. This means that SetCount() will call delete[] on the uninitialized _bits pointer field, leading to undefined behavior.
2013-08-24 17:49:14 +02:00
Shauren
75cc4e7b25 Core/Auras
* Fixed unsafe removal of charm auras, it is now safe to remove them inside AI hooks
* Fixes crash in SmartAI::EnterEvadeMode

Closes #8679
2013-08-20 00:43:03 +02:00
joschiwald
e0f010b310 Scripts: Random script fixes and code optimizations 2013-08-19 20:03:06 +02:00
joschiwald
2b19ba1879 Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes 2013-08-18 01:41:10 +02:00
Vincent-Michael
da1e466bd5 Core/Misc: Implemented GetObjectScale function 2013-08-17 23:47:43 +02:00
joschiwald
c45e665c86 Core/Spells: move spell resistance calculation into separate function (and some cosmetic changes)
Ref #7254
2013-08-17 00:47:44 +02:00
betagan
c81c198d4c Core/Spells: Fix deathknight gladiator glove bonus
Closes #512
2013-08-16 02:50:47 +02:00
Shauren
d1bb6da668 Core/Spells: Fixed cast time mods using two charges on every cast 2013-08-15 16:34:57 +02:00
Shauren
2ac6380202 Core/Auras: Allow preventing whole aura proc default handler from script hooks, just how it is possible for separate effects 2013-08-15 16:32:22 +02:00
joschiwald
e87402dd05 Core/Spells:
- corrected structure of SMSG_PET_CAST_FAILED (fixes highlighted action buttons)
- simplified spell focus check
2013-08-14 15:45:36 +02:00
Vincent-Michael
147c7d5243 Core/Spells: Fix Rogue T10 4P bonus
Closes #4153
2013-08-12 13:04:52 +02:00
Vincent-Michael
4c64e407b7 Core/Spells: Convert hunter "Improved Mend Pet" in spell script
Closes #5597
Closes #9006
Closes #10346
2013-08-11 19:23:21 +02:00
Nay
2abaf6224e Core/Player: Add debug log when SendCanTakeQuestResponse(INVALIDREASON_*) is used
Intent is to find broken quest chains
Requested by Aokromes
2013-08-11 16:36:36 +01:00
Nay
d0bde02b21 Core/CreatureAI: Do not remove clone_caster auras on evade (in addition to control_vehicle auras) 2013-08-11 15:52:23 +01:00
Spp
b05665660a Core/Battleground: Get rid of dinamic casts BattlegroundXX outside Battleground scope by implementing generic functions (1/2)
- HandleQuestComplete, CanActivateGO and IsSpellAllowed
2013-08-07 10:31:13 +02:00
Nay
ebaee135c9 Server/Player: Fix a logical mistake in ApplyEquipCooldown
Thanks Joschiwald
2013-08-06 18:19:18 +01:00
Nay
8dfaf27d25 Merge pull request #10245 from Mihapro/master
Core/SmartScripts
2013-08-06 08:55:41 -07:00
Nay
8dccf61005 Merge pull request #10445 from Discover-/Cooldown-Exploit
Core/Items: Fix an exploit where players would be able to reset the cool...
2013-08-06 08:35:57 -07:00
Nay
1bf1f95a8e Merge pull request #10455 from Discover-/Battleground-Reinterpret-Casts
Core/Misc: Implement reinterpret casts for all battleground classes and ...
2013-08-06 08:31:59 -07:00
Discover-
7f744de746 Core/Misc: Implement reinterpret casts for all battleground classes and use them. 2013-08-06 13:26:52 +02:00
Nay
2bd4049890 Scripts/Commands: Fix compile (v2) 2013-08-05 22:55:06 +01:00
Nay
ccdba0859d Core/Items: Correct randomProperlyId type when reading to/from DB
Ref #10446
2013-08-05 19:59:54 +01:00
Aokromes
1dcd027426 Merge pull request #9761 from xjose93/ImproveLog11
Core/Logs: Added functions GetMapAreaAndZoneString() and GetCoordsMapAreaAndZoneString()
2013-08-05 01:13:52 -07:00
Discover-
4bb49378fc Core/Items: Fix an exploit where players would be able to reset the cooldown of items to the equip cooldown (30 seconds) when unequipping, equipping and then relogging. 2013-08-04 23:10:21 +02:00
Shauren
20a61b6400 Core/Creatures: DoTs and self damage will no longer reset time since last damage taken for stopping creature from evading 2013-08-02 19:56:48 +02:00
joschiwald
a522be8108 Merge pull request #10336 from joschiwald/spellscripts5
Scripts/Spells: backport some SpellScripts from 4.3.4 branch
2013-07-23 17:21:17 -07:00
joschiwald
99c67c103d Scripts/Spells: backport some SpellScripts from 4.3.4 branch
- Fix Earth Shield
- Fix Necrotic Touch
- Fix Reflective Shield

Closes #9145, #9163, #9665
2013-07-24 02:13:49 +02:00
Nay
5463f211b4 Merge pull request #10323 from joschiwald/spellranks
Core/Spells: use SpellInfo class to get spellrank node instead of SpellMgr helpers
2013-07-22 16:28:35 -07:00
joschiwald
2d6a48840c Core/Spells: use SpellInfo class to get spell rank instead of SpellMgr helpers 2013-07-21 13:37:34 +02:00
joschiwald
380cf5d241 Core/Misc: replace (Player*) casts with ToPlayer() 2013-07-21 01:38:21 +02:00
Vlad
0b9a8ccef5 Core/Misc: Change creatures and gameobject phasemask from 16 to 32 bits
Signed-off-by: Nay <dnpd.dd@gmail.com>
2013-07-19 04:03:40 +01:00
Warpten
cd3a7f4175 Core/Players: Dueling players in your party / raid should not make them always detectable.
Fixes seeing stealthed rogues & druids, as well as invisible mages in duels.
2013-07-14 16:46:11 +02:00
Shauren
330dd624b6 Core/Movement: Do not remove movement flags that have special opcodes associated with them on teleport
Closes #10162
2013-07-13 15:26:10 +02:00
Shauren
30f6efb416 Core/Quests: Fixed quest sharing 2013-07-11 21:45:14 +02:00
Mihapro
e00fc19779 Core/SmartScripts 2013-07-08 18:01:41 +02:00