In new version last update time stopred for specific Cell that store all world objects
placed in it. All objects of Cell updated (or not updated) in same time.
Original version provided by ciphercom.
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.
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.
* Add IsHostileTo/IsFriendlyTo and implement expected way checks for diff. world object types.
For controlled object check redirected to specific owner, for wild gameobject base at gameobject faction.
If faction not set expected to be hostile to anyone.
* Update grid searchers to be usable with world object instead only unit case.
Some grid searches lost redundent second object arg, AnyAoETargetUnitInObjectRangeCheck lost hitHidden arg
(for hitHidden==true case added new AnyAoEVisibleTargetUnitInObjectRangeCheck)
* Updated grid searchers used with gameobject area casts now.
Note: Gameobject area spell cast animation will still wrong show around cast triggering target instead
center around gameobject.
* In case gameobject aura apply to target for restored use target itself as caster because
we not have currently another way apply aura form wild gameobject.
* 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.
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>