Commit graph

89 commits

Author SHA1 Message Date
VladimirMangos
0847d4c8cd [10683] Revert "[10677] Send to creature/etc Update call real diff from last update and use it."
This reverts commit 10784a8c7cc81c468b5411e973d36ecf31de9603.

Main reason: impossibility for me as commiter test problem and fix all corner cases problems.
2010-11-05 19:54:31 +03:00
cipherCOM
555c1a9094 [10677] Send to creature/etc Update call real diff from last update and use it.
Now in case when creature/etc some tices not updates in result stay
in not active (no near players or active objects) cell some important
timers (corpse decay, summon timers, group loot expire, aura durations, etc) will
updates at real diff time from last prev. update call.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

For some systems added exclude use real diff time because current limitations
like move generators. So its stay use last tick diff and considered freeze and
skip all time while creature in not active map part.
2010-11-03 07:07:13 +03:00
VladimirMangos
2170c9c919 [10529] Water level in movement use fixes.
* Move selection allowed upper and lower heights for target point
  into near point core function used for contact/close point selection.
  Selection base at possibility target point searcher fly/swim(or walk by water bottom).
* Use vamp water level data so have proper water level in instances in movements.
* Use increased ground search distance for water level case.
2010-09-25 08:01:28 +04:00
VladimirMangos
acd0716297 [10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
2010-09-02 05:13:16 +04:00
VladimirMangos
45cdc67f58 [10338] Create Map version for GetPlayer/GetUnit fucntions
* This let make map local way access for cases when player/all units
  expected to be at same map (for scripts cases for example).
  Ofc, still exist many places where code expect world wide player search.
  Spell casting for support far target cases, groups/guilds/chat/etc packets

* Function Unit::GetUnit depricated and will removed soon.
* Function GetCreatureOrPetOrVehicle renamed to less horriable GetAnyTypeCreature name.
2010-08-10 23:22:11 +04:00
Lynx3d
730b4deaaf [10272] Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly.
This finally prevents flying creatures from falling to infinity (basically instantly diappearing) in several instances,
aswell as prevent creatures from falling inside larger solid object around the world.

Default height search is untouched, needs more research on how creature AI etc. will be affected.
2010-07-26 08:09:08 +02:00
Lynx3d
5e89098a61 [10165] New collission system (vmap) implementation
Important:
* You have to re-extract and assemble vmaps
* Update your config file, new option 'vmap.enableIndoorCheck' added

New features:
* Include WMO+DBC area information for correct subarea identification and indoor check
* Support for WMO liquid (fishing/swimming in cities, instances and oterh WMO based environments)

Technical changes:
* New Bounding Interval Hierarchy (BIH) data structure for better performance
* Referenced model data for reduced memory usage,
  needs more files, but reduces overall file size from ~1.9GB to ~550MB

Additional Authors:
arrai (DBC handling and indoor detection)
faramir118 (windows support and bug investigation)
And of course thanks Vladimir for a lot of patience and support!
2010-07-08 23:17:26 +02:00
VladimirMangos
67a7892075 [10114] Store associated InstanceSave for dungeon map in Map object 2010-06-27 21:11:26 +04:00
SilverIce
6ca609629c [10073] Make object active at applying view on it
also isActiveObject check moved to WorldObject - all worldobjects are inactive by default, excluding players
this is a final part of cameras implementation

(based on commit efc9623)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also remove template-way code selection for object for Map::AddToActive/Map::RemoveFromActive.
This simplify function use from not Map code.
2010-06-18 00:19:12 +04:00
SilverIce
e427ce80cc [10052] Camera System
(based on SilverIce's repo commit 4f2f4ab + next 3 more)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-06-14 07:23:03 +04:00
XTZGZoReX
aa62225c68 [9996] Remove grid state debugging code and move state machine to MapManager. 2010-05-28 15:01:04 +02:00
XTZGZoReX
28c3de5093 [9995] Move GridMap class (and related structs/enums) to separate cpp/h.
Also rename some structs/enums and fix some code style.
2010-05-28 13:34:14 +02:00
VladimirMangos
48254e3879 Cleanups in instance_template and map entrance DBC data. 2010-04-17 15:24:49 +04:00
SilverIce
53eeebf2fe [9725] removed PlayerNotifier and related Map::UpdatePlayerVisibility function, used UpdateObjectVisibility instead
(based on SilverIce's repo commit e226019)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Note: this changes not affect in any good/bad way recent problem with player guids.
2010-04-11 06:27:57 +04:00
hunuza
6750ce9185 [9650] Some corpse related clean ups.
Old bones remove code anyway was dead, so remove it.

Signed-off-by: hunuza <hunuza@gmail.com>
2010-03-31 16:40:47 +02:00
XTZGZoReX
51fd11c92c [9638] Replace all C assert()s with MaNGOS ASSERT() macro. 2010-03-29 19:29:42 +02:00
balrok
1b2eefd721 [9598] update battlegrounds per map + cleanup at delete
this will be useful, if we have multithreaded mapupdates one day

since i couldn't reproduce any errors regarding to self deletions of
battlegrounds i removed the m_deleteThis variable
2010-03-17 00:47:22 +01:00
VladimirMangos
a12fecab0d [9575] Use ObjectGuid in Map object stores/world access/search. 2010-03-12 14:38:38 +03:00
VladimirMangos
c4f3578226 [9571] Create and use ObjectGuidGenerator/IdGenerator template classes.
* This is let finally hide guid structure in ObjectGuid.h/.cpp code.
* Shared related code.

NOTE: while switch to use new clasess one more problem has been detected
with not-safe code in .pdump work for future per-map multi-threading.
It's need rewrited before will possible safe use in like case.
For current single world thread case it's safe.
2010-03-11 16:32:09 +03:00
VladimirMangos
5af05a314e [9405] Make all movements instant applied.
* Drop delayed moves list in Map code
* Apply movement coords update always at call including movement to different cell/grid.
* Instead removed functionality mark creature as need move notify broadcast at next tick, do it.

This must resolve porblesm with CreatureRelocation in past not always update position to new expected at call
And in resul next code fail or work in strange way. Mark creature for notifier call at next Update
let safe main part remopved functionality implemented in another way: prevent cascade (or infinity chain)
in move updates. In fiture possible implement move notify call not at each tick for save time.
2010-02-18 01:09:33 +03:00
VladimirMangos
55bc9e8da7 Include build in to .map files data.
This let not update map fiels format version at switch to new build
for prevent use wrong .map files. Build checked at loading.
2010-02-03 16:17:13 +03:00
XTZGZoReX
0ff9250de2 [9245] Remove CellLock class and all cell-level thread locking.
* It was wasting CPU power as cell-level locking is not needed.
* Future multithreading will be on map-level.
* CellLock was just a 'proxy' between Cell and CellPair and in some cases carried redundant data.
* Some minor cleanup in Cell::Visit/Map::Visit.
2010-01-23 21:36:15 +01:00
VladimirMangos
fe6e2e1746 [9122] Updated copyright notice for new year.
Also fix some lost in past cases.
2010-01-08 00:02:21 +03:00
DasBlub
ebb063beb9 [9107] Fix most of the gcc warnings
* use UI64FMTD instead of "%u" for uint64 output
* on most *NIX systems, I64FMT is "%016lX" and not "%016llX"
* also fix typo: renamed GridMap::loadHeihgtData to GridMap::loadHeightData

Note: there are still many warnings from the 3rd party libraries g3dlite and ACE. Those warnings won't be fixed with that commit.
Also, a few warnings from MaNGOS are left, they'll be fixed later.

Signed-off-by: XTZGZoReX <xtzgzorex@gmail.com>
2010-01-03 15:30:22 +01:00
VladimirMangos
aa372cbfda [9103] Make gcc happy with muti-byte char casts and use more readable magic strings. 2010-01-02 20:46:22 +03:00
VladimirMangos
f66f0a0914 [8832] Fixed typo in difficulty name 2009-11-19 03:50:10 +03:00
VladimirMangos
398ca010ca [8831] Helper function add and move for diffficulties.
* Use regular naming for 0 spwanmode/difficulty for clean consistence names (used at well known wiki)
* Move difficulty related data access from InstancedMap to Map class.
2009-11-19 03:05:52 +03:00
VladimirMangos
37ba6623bb [8828] Independent instance reset time for different difficulties.
* 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.
2009-11-18 10:08:41 +03:00
balrok
c50df41b3c [8775] implement all creature difficulties + support bgs with this
former know as heroic_entry we now have 3 of those
which let us chose different creature_templates for different
map-types

normal maps will need a bit more support to use correct
spawnmodes

but for battlegrounds it works already good:
they are divided by levelrange:
    0-59  == normal spawn -> spiritguides level 60
    60-69 == difficulty=1 -> spritiguides level 70
    70-79 == difficulty=2 -> spiritguides level 80
    80    == difficulty=3 -> spiritguides level 80

this is needed mostly for alterac valley to get
right creature-templates spawned
and with that all creature->SetLevel hacks could
get removed from alterac valley code
2009-11-05 10:48:15 +01:00
VladimirMangos
d7ae5e3af0 [8718] Remove most GetObjectInWorld functions and move some map local to Map
Also mape pet guid counter per-map (in different expecte to be global pet number)
2009-10-24 01:16:40 +04:00
VladimirMangos
b942616ded [8710] Make vehicle guid counter per-map local.
Also update/drop/move to Map some dependent functions.
2009-10-22 17:43:41 +04:00
VladimirMangos
d482193cea [8705] Move DynamicObject guid counting from global levle to map.
This is first step in guid counting for map local object types at map level.
Map local countin let
1) have more wide guid space and then more seldom have problems with guid counter overflow
2) possible implement (later) restart map at guid overflow without server shutdown.
3) let use static guids (not for DynamicOPbject that not stored in DB anyway) in instances instead dynamic allocated.
2009-10-22 06:49:35 +04:00
seirge
f015e77a07 [8680] Spawn objects only in loaded grids (not just created)
Real object creating in grid make sense only if grid data already loaded, in other cases
gameevent/pool related object will loaded at normal grid data loading.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-10-20 11:34:01 +04:00
VladimirMangos
8bf52f7c63 [8678] Move objects updates store and proccessing for send to client in per map way. 2009-10-19 23:46:58 +04:00
ApoC
45c9c136ba [8653] Implemented per map guids store.
This patch implements storing guid->object pairs on per map level, this leads
to less locking in ObjectAccessor in case of further multithreaded map update.

For case of cross map guid looking (auras cases) all maps are linked into
ObjectAccessor and can be traversed for this lookup.

Signed-off-by: ApoC <apoc@nymfe.net>
2009-10-17 00:12:31 +02:00
NoFantasy
9cb356851c [8626] Add missing argument names in function declaration.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2009-10-11 16:37:41 +02:00
VladimirMangos
a9af7f2b1c Use reset time for normal/heroic from new DBC. Improve basic support for raid difficalties. 2009-10-06 02:12:02 +04:00
tomrus88
546f7a7fe5 Merge commit 'origin/master' into 320
Conflicts:
	src/game/BattleGround.cpp
2009-09-28 19:52:54 +04:00
balrok
bd87209498 call OnObjectDBLoad(Creature/GameObject) for battleground at object-loading
this is a virtual function and can be used to move gameobjects
and creatures from battlegroundcode to database

for this i also had to add a BattleGround-pointer to the map
so i renamed CreateBattleGround(instanceid) to CreateBattleGroundMap(instanceid, Battleground*)
2009-09-28 16:15:01 +02:00
tomrus88
258e19a4a3 Merge commit 'origin/master' into 320 2009-09-22 18:14:06 +04:00
Ambal
cfea99ea62 [8524] New cell search algorithm implemented. You can now choose different visibility distances on continents, in BG/Arenas and instances.
Please, update your config files and check new options:

Visibility.Distance.Continents    = 90
Visibility.Distance.Instances     = 120
Visibility.Distance.BGArenas      = 180

Thanks everyone involved in patch tests!

Signed-off-by: Ambal <pogrebniak@gala.net>
2009-09-21 23:25:29 +03:00
VladimirMangos
7974e1ebcb Merge branch 'master' into 320 2009-09-10 05:46:08 +04:00
balrok
bd30769dec [8475] fixed some gcc-warnings
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>
2009-09-05 13:47:47 +02:00
tomrus88
f90f3dd987 Merge commit 'origin/master' into 320
Conflicts:
	src/game/ArenaTeam.cpp
2009-07-29 15:17:37 +04:00
Sorya
7f38da23fd [8272] Fixed typos in world 'height' by code.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also some other code style fixes.
2009-07-29 10:04:53 +04:00
tomrus88
be8eaf4e46 Just merge commit 'origin/master' into 320
Conflicts:
	src/game/MiscHandler.cpp
2009-07-28 17:05:38 +04:00
Ambal
64f11bedf7 [8252] Move DB scripting code from global World to Map.
This one more step to pre-map events proccesing and parallel in future.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-07-26 12:20:59 +04:00
tomrus88
1a47420fe8 Merge commit 'origin/master' into 320
Conflicts:
	src/game/Map.cpp
	src/game/MapInstanced.cpp
	src/game/Player.cpp
	src/game/SpellEffects.cpp
	src/game/Totem.cpp
2009-07-15 09:40:13 +04:00
Ambal
58209ee79a [8182] Store and use Map* pointer in WorldObject instead map ids for speedup
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>
2009-07-15 02:13:52 +04:00
tomrus88
02bcc56919 Added placeholders for new battlegrounds, some other stuff. 2009-06-25 19:08:53 +04:00