Commit graph

231 commits

Author SHA1 Message Date
Yaki Khadafi
e9bee9b0b0 Update UpdateFields.h. Drop redundant powers and happiness.
thx Strawberry

Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
2020-02-16 02:25:30 +00:00
Machiavelli
21a3ee9267 [12079] Remove some redundant explicit NULL checks for pointers before delete or delete[] calls since this check is done implicitly when deleting
Signed-off-by: stfx <stfx@hotmail.de>
2012-08-03 14:30:18 +02:00
Schmoozerd
835d1c7479 [12069] Cleanup comment style 2012-07-22 14:39:31 +02:00
Schmoozerd
e32b9953a1 Cleanup Operator padding 2012-07-20 17:38:23 +02:00
Schmoozerd
94795f2bff Various Cleanups (game N-O) 2012-07-19 21:51:08 +02:00
Reamer
ea30899db4 [12027] Add some VMap LoS checking functions to Map scope 2012-07-05 19:37:35 +02:00
stfx
a309de2e6d [12022] Some more warning fixes 2012-06-25 15:56:53 +02:00
stfx
f3f3349661 [11973] Various Cleanups
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-04-22 19:48:05 +02:00
Schmoozerd
675c8c41cf [11966] Replace an ASSERT to prevent unnecessairy crashes
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>
2012-04-16 20:41:49 +02:00
stfx
a66a40dc99 [11952] Add support to send the anim for SMSG_TAMEOBJECT_CUSTOM_ANIM
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-04-12 21:53:24 +02:00
Schmoozerd
49bd484a41 [11922] Add ASSERT helper function to print entry and guid info
Use this in first cases: GetAngle and in PathFinder::BuildPolyPath

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-02-07 17:25:46 +01:00
faramir118
6c8000705f [11919] Improve GetNearPoint 2012-02-07 00:04:25 +01:00
C:/Program Files (x86)/git/dev/rsa
2c175f6d82 [11882] Improve a few functions related to Angle calculation
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-01-23 22:51:19 +01:00
Schmoozerd
8068dcf6dd [11875] Update Copyright notice to year 2012
Start timemachine and a Happy new year to all!
2012-01-16 17:43:59 +01:00
SilverIce
d62061f423 missing changes from my prev. commit 2011-10-13 20:44:56 +03:00
SilverIce
df0715284f [11819] move SetActiveObjectState to WorldObject level 2011-10-13 20:08:49 +03:00
SilverIce
7a67f27ab3 [11806] A bit gameobject code refactoring 2011-09-26 00:12:12 +03:00
Midna
cad083b1a8 [11805] Send unit movement speeds in the proper order, correct baseMoveSpeed value order
Signed-off-by: SilverIce <slifeleaf@gmail.com>
2011-09-25 09:53:54 +03:00
SilverIce
9d566398ad [11720] Implement spline movement subsystem
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.
2011-07-08 17:25:13 +03:00
VladimirMangos
15bb164d72 [11659] Rewrite object pos selector.
* 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.
2011-06-21 22:33:33 +04:00
VladimirMangos
e776dbbfc8 [11658] Revert "[11298] NearUsedPosDo searcher should add only units with correct coordinates. Possibly can help with freezes when 'DetectPosCollision = 1'."
This reverts commit a79ca96e4ae7b6ab1b70319e8b3011253068c841.

This restore work object pos selector for units.
Reverted commit make fully disabled it work for multiply attackers case.
2011-06-20 22:51:41 +04:00
Schmoozerd
2d82b4bccc [11575] Add support for simulating Yells to Map.
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>
2011-05-31 05:17:47 +04:00
VladimirMangos
c5b6cc0b37 [11543] Fixed change form to same (powershifting)
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.
2011-05-26 17:18:47 +04:00
SilverIce
7c86d3f477 [11529] Pack and send to client all gameobject's quaternion components which allows place gameobjects cornerwise.
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.
2011-05-24 03:49:13 +03:00
VladimirMangos
249fb836ca [11490] Alow implicit cast ObjectGuid->uint64 and only explicit uint64->ObjectGuid
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.
2011-05-15 22:04:57 +04:00
NoFantasy
ecdb435b1e [11489] Remove the old and custom UNIT_NPC_FLAG_GUARD for creatures.
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>
2011-05-14 19:17:13 +02:00
VladimirMangos
ef6a48fe03 [11465] non-ObjectGuid guids in random places.
Only ChannelMgr code wide use uint64 guids now, and Map object stores.
2011-05-10 21:27:49 +04:00
VladimirMangos
44f2c26389 [11459] More ObjectGuid using in Aura/SpellAuraHolder code.
Also fix build in PetAI code. Thanks to rsa for fix code.
2011-05-09 23:17:39 +04:00
SilverIce
eb678ce092 [11388] Don't add MOVEFLAG_ROOT in case creature has no moving state
need unroot unit before move or not use that flag at all
2011-04-21 15:00:38 +03:00
zergtmn
84482b81ac [11386] Revert small unexpected change -_- 2011-04-21 00:24:29 +06:00
zergtmn
2835aa5f20 [11385] Add support for static vehicle spawns
Signed-off-by: zergtmn <zerg@myisp.com>
2011-04-20 23:23:47 +06:00
Ambal
695ad4d54e [11342] Use Position struct to hold object coordinates - minor code refactoring.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-04-13 02:25:07 +03:00
VladimirMangos
96045a86e3 [11325] Made recently added coordinates check only for debug build mode. 2011-04-08 00:12:25 +04:00
VladimirMangos
ba77d85a30 [11323] Avoid explicit use HIGHGUID_UNIT as creature high guid in guids or creature creating.
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.
2011-04-07 21:15:27 +04:00
Ambal
5833d74963 [11298] NearUsedPosDo searcher should add only units with correct coordinates. Possibly can help with freezes when 'DetectPosCollision = 1'.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-03-30 09:35:02 +03:00
NoFantasy
167ec0df42 [11250] Fix create position for summoned creatures.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-03-15 09:43:32 +01:00
VladimirMangos
2b65cdb3bb [11244] Collect in CreatureCreatePos data for delayed pos setup into Creature::Create.
* 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.
2011-03-14 06:18:34 +03:00
VladimirMangos
51b4556c4b [11222] Move possition setup for Creature and subclases before Create call.
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.
2011-03-06 12:47:37 +03:00
VladimirMangos
f1899e3b27 [11206] Move visibility self/around to new function and use it.
* 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.
2011-02-27 19:23:05 +03:00
VladimirMangos
71d672062e [11185] Not use local varibale name same as function name. 2011-02-18 05:30:10 +03:00
VladimirMangos
cf685da47a [11139] Use for Creature/GameObject local per-map guids
* 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.
2011-02-12 09:52:16 +03:00
VladimirMangos
f73868a703 [11117] Allow for non-instancable maps have InstanceData and instance scripts.
* 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.
2011-02-08 04:15:13 +03:00
VladimirMangos
3570dcf74e [11079] Cleanup for range use in monster say 2011-01-29 06:40:09 +03:00
Skirnir
75b4f75f4d [11066] Remove tail whitespaces.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-25 00:22:29 +03:00
VladimirMangos
d0e2c2e9af [11027] Move repeatable code to Object::MarkForClientUpdate()
This function can be used for cases when need sedn object update
for dynamic flags update.
2011-01-17 18:16:23 +03:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +03:00
Ambal
b11820593c [10924] Send time diff between Update() calls for object - should help with mob respawn on inactive grids etc. Based on patches by VladimirMangos and cipherCOM. All issues from previous patches should be finally fixed now.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-12-27 22:27:20 +02:00
VladimirMangos
cc0655a402 [10782] Use Team enum types in all appropriate cases and catches bug in result fix.
* 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.
2010-11-25 01:11:17 +03:00
Schmoozerd
16cd545df8 [10761] Basic support for target-name in MonsterSay/etc
Change MonsterSay's target to pointer.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-20 21:27:21 +03:00
Schmoozerd
ca56284912 [10759] Correctly reset mob orientation upon reaching spawn point. Should also improve visualisation of mob orientation on clients
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-11-20 19:38:18 +02:00