GetAngle can be called for self from very many places, not only DB-errors, hence adding the assert is too strong in the moment
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
Spline movement controls movements of server-side controlled units (monster movement, taxi movement, etc).
Proper implementation of effects such as charge, jump, cyclic movement will rely on it.
However, need improve our states system before.
Technical changes:
1. Added linear, catmullrom and bezier3 splines which based on client's algorthims. They can be reused for proper transport position interpolation.
2. Precission increased. There are no more position desync issues since client's position calculation formulas used.
3. Now possible to move by paths with multiple points, send whole path to client.
* Instead coordinates use angle projections to expected pos distance circle.
This let do mostly only angle comparison and then speedup checks.
* Fixed some long existed bugs in algo and simplify code. Possible more work need.
This reverts commit a79ca96e4ae7b6ab1b70319e8b3011253068c841.
This restore work object pos selector for units.
Reverted commit make fully disabled it work for multiply attackers case.
Including case when related creature not loaded.
For proper animation yell from loaded creature for near players
better use correct lowguid/guid if creature.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Inspired by patch provided by darkstalker.
Client expected receive form field change at form switing including case with switch to same form.
In fact problem too good mangos optimization in part avoid send unchanged values in update fields.
* Added function Object::SendForcedObjectUpdate()
* It used in form apply code for make sure received by client non-form applied state in middle form shifting state.
* It also used for fishing code when client also expected received some update fields chnages before
animation update. New function send update to all all client instead before used code that send it to fishing player
and resend later one more time to other players and player itself as normal update.
Update '.gobject turn' command, now you have to specify 3 rotations to turn gameobject: rotation angles around z, y and x axes.
Note to DB devs: use QuaternionCompressed::Unpack to extract rotations from the data that came with UPDATEFLAG_ROTATION.
Now safe allow this casts in like way after completed convertion to ObjectGuid use.
Also simplify code in result allowed auto cast to uint64.
Please _not_ add new uint64 storages (local and in structures) for guid values.
Existing data moved to flags_extra field, with value CREATURE_FLAG_EXTRA_GUARD (0x400 / 1024).
Remove isGuard() from Unit class to a new IsGuard() function in Creature class.
Signed-off-by: NoFantasy <nofantasy@nf.no>
This helper change for allow have in future static spawned vehicles as `creature` table data.
Added CreatureInfo::GetHighGuid() high guid selector, and wrapper CreatureData::GetHighGuid()
for most real cases of usage. Also easy get expected guid form by CreatureData::GetObjectGuid(lowguid).
Also fixed some memory lost cases at creature spawn fail.
* CreatureCreatePos work in 3 modes:
- exactly provided coordinates/orientation/map/phasemask
- exactly object + orientation as coordinates/map/phasemask
- delayed position calculation near provided object at specific dist/angle.
* Use in similar way and for Pet/Vehicle Create functions.
For Totem created new Totem::Create function with some moved in to it totem specific code.
* This let resolve recent problems with creature spawn and preserve fix for cases when
Creature::Create addon/script code expected known correct possition for creature.
Some called from Create code can req. proper pos setup for creature.
Bad side: But in way how currently code orginized impossible setup excetly position for most
Creature sublasses. So in this part need more work.
* Fixed wrong visibility changes in some cases at .mod phase uses.
* Apply phase change to any owned units (not only pets as before).
It also will applied in more safe way for avoid unexpected lost owner at update.
* Check view point setting auras targets accessability not only at visibility change
but also at phase change.
* Replace SetVisibility(GetVisibility()) hack like calls.
* Creature/GameObject guid generators moved to Map
* For avoid wrong not converted cases generic function in ObjectMgr has been replaced by
specilized guid generation function like sObjectMgr.GeneratePlayerLowGuid().
This let catch all cases that need update in custom code or scripts.
* Drop many ObjectAcessor.h now dead code. This is also make mangos more thread safe.
* Restore one more time unix build broken in prev. commits.
Note: many cases when something not wotk in instance but work in continents
possible magicly start work after this commit. For example, some gm commands.
From large systems that need more chnages for start work in full power in instances
can be referecned pool/gamevent system. Last need just small hacks drop changes but
in will addded in independent commit.
* New table added for non-instanced maps (except BG/arena):
- `mangos`.`world_template` (script mapping to non instanced data)
- `characters`.`world` (saved script data string storage)
* InstancedData created for any map types including BGs/arenas, that allow have scripts
state for any maps, but BG/arena instance data not saved.
Note: Possible structures will renamed later for clarify apply to any type maps,
but avoid for now for simplify changes and hard affect to script library sources.
* Fixed wrong arenaid use at leave arena queue.
* Fixed memory lost and etc at not virtual EndBattleground call
* Fixed crash at arena join with fake data from client.
* Code cleanups.