This reverts commit 10784a8c7cc81c468b5411e973d36ecf31de9603.
Main reason: impossibility for me as commiter test problem and fix all corner cases problems.
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.
* 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.
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
* 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.
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.
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!
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.
(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.
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
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
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
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.
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>
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>
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*)
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>
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>