* Use AddMonsterMoveFlag instead SetMonsterMoveFlags for set walk-mode
* Apply walk/run mode to all copntrolled units (except totems).
* Synchronize walk/run mode at pet creating/loading.
or actualy i didn't introduce a new crash there.. the old crash
just changed a bit..
after we force the player to logout without valid mapcoords the player wasn't in
world anymore and through that Getplayer()->GetMap()->RemoveFromWorld()
caused a crash..
i changed now the error handling inside farteleport there.. instead of forcing
a logout without saving, i just port him to his homebind
which will be much nicer
(minor cleanup with the other homebind teleportation.. we don't need to check
for the error there.. homebind realy should be a valid coord)
* Store reset time for map/difficulty pairs.
* Use DBC data for reset time and max players instead `instance_template` fields (dropped)
for each existed map/difficulty pair.
* Fix some "heroic" related checks in spells/etc.
all warnings from Wunused
and some from Wall
cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code
for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint
also note for coding:
if you do something like
if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)
Signed-off-by: balrok <der-coole-carl@gmx.net>
* Move CMSG_MOVE_KNOCK_BACK_ACK (player case) to Unit::KnockBackFrom
* Implement creature case, most at hack way currently :(
Need information about expected server packet, and possible some disorientation movegen apply at short time.
* In adition of spell 781 implement related creature versions.
* Fixed warnings spawn at reading CMSG_MOVE_KNOCK_BACK_ACK, CMSG_MOVE_HOVER_ACK, CMSG_MOVE_WATER_WALK_ACK.
CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd
could crash due to the asserts in ByteBuffer.h. That was exploitable by
malicious players.
Furthermore, there were duplicate checks: Additionally to
CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye
on not exceeding the packet boundaries - just to crash the server for
sure in such a case.
To prevent memory leaks or other undesirable states, please read in
every handler all variables _before_ doing any concrete handling.
Also some code logic cleanups.
Changes let make more cleanups in base map access and other places,
but this chnages not inlcuded in patch.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* IsInWorld used to prevent return unexpected not in world objects.
* Delayed operations need to process its in world state.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* Create new monster move field in Creature class and use it in all cases when expected use MONSTER_MOVE_* flags.
* Store and use MOVEMENTFLAG_* values in field in MovementInfo structure of Player class.
* Cleanups and fix related code.
NOTE: DB in creature_addon store values similar MONSTER_MOVE_* flags, scritps also expected set only this flags.
* IsInWorld used to prevent return unexpected not in world objects.
* Delayed operations need to process its in world state.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* Create new monster move field in Creature class and use it in all cases when expected use MONSTER_MOVE_* flags.
* Store and use MOVEMENTFLAG_* values in field in MovementInfo structure of Player class.
* Cleanups and fix related code.
NOTE: DB in creature_addon store values similar MONSTER_MOVE_* flags, scritps also expected set only this flags.
* Replace platform seelction MaNGOS code for select format descriptor for uint64 by using ACE define.
I64FMTD renamed to UI64FMTD for more clear name.
* Add new define UI64LIT (base at ACE seelction) for build portables uint64 literals.
Please always use UI64LIT(0x00001) instead less portable 0x00001LL