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)
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.
- 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
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.
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>
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.