Also other classes have been affected, due to the use of search&replace.
This will probably break some patches and 3rd party libraries, so make sure to update them if required.
Thanks to Phille for the original idea and patch!
Possible real source of problem: existing in code mixed
std:: structure templates instanting under pack pragma and out.
And this incompatible structure layouts wrongly mixed used by GCC.
So all std:: strcutures used moved out from pack pragma guards.
Add a default define and use it instead of hard coded value.
Some additional minor corrections for transport GO's
Signed-off-by: NoFantasy <nofantasy@nf.no>
By unknown reason GCC generate wrong code for locale structures declared in header after pack pragma.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This allow GO's not summoned by any to be processed and use the spells as defined in GO template as expected.
In addition some new checks to determine if GO should despawn and if group membership should be checked or not to allow use.
Signed-off-by: NoFantasy <nofantasy@nf.no>
* This is also hack because some float with unknown exactly value used as 'size'
* Another not resolved problem: go size used in creature target autoselection, so for large 'virtual' go
creature can seelct strange points near in attempt select 'free' place near target.
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.
* GAMEOBJECT_TYPE_BUTTON can have linked traps
* Spell::EffectSummonObject also can summon objects with linked traps
Thanks to patman128 for research second case.
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>
* Added basic infrastructure for visibility update in case difference player and current view point.
Just for note: seletect additional arg way beacuse repeatable search object will slow but store pointer will not safe,
so use middle case: get view point pointer early as possible at visibility updates.
* Implement dynamic object and creature activisation while it's target of far sight spell effect
* Use this for SPELL_AURA_BIND_SIGHT, SPELL_AURA_FAR_SIGHT and SPELL_EFFECT_ADD_FARSIGHT.
* Note2: some spyglass like spells let look _around_ at long distance, this hard implement in current grid loading system
Without additional changes and not implemented (you will see empty area without creatures in likes case)
* Also fixed warning spam at CMSG_MOVE_SET_CAN_FLY_ACK receive by use proper packet sructure reading.
* Not set owner for will summoned gameobjects.
Its not expected to have owner, and must be accessable to all players (or team).
* Set for all objects summoned by spells: despawned by deafult for proper despawn withut owner.
* Cleanup Spell::EffectSummonObjectWild.
* Drop horribale hack with stored charges amount, use instead GO info charges data as expected.
* Count trap activations as charge uses if it have limited charges.
* Check trap reactions only in ready spawned state.
* Implement use `consumable` field in gameobject template for gameobject required explcit despawn at use.
* Move gameobject template fields cech function from Gameobject to gameobject template class, and update callers.
* Cast spells at gameobject use with gameobject guid as original caster guid, as already used in some other cases.
* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
* Create Gameobject version to make GO with owner more safe for remove
* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
* Create Gameobject version to make GO with owner more safe for remove
Many in world gameobject that unexpected daspawned before must now work in more expected way.
In tests i not found any damage to bg gameobject work, and at least this restore expected work for non-bg dorrs//buttons broken
after half-year ago patch (that has been reverted partly in this commit)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* Fixed update absent in ".gobject turn" command
* Propetly set rotation fields for summoned objects
* Check rotation/coordinates fields values at server loading
Active objects triggrering grid loading and updating around self like players.
It can be used for event long run movements or escoring quest travels.
Also can be used for proper implementation far vision spells.
Currently only creatures can be activated by function call (from script) cr->SetActiveObjectState(true);
Please avoid lot amount active objects in same time use. Existance active objects support isn't meaning
that each rabbit must be active creature.
Also added independent grid unloading locks for explicit unloading lock,
lock for used by instance copied grids, lock counter for actiove object spawn grids locks.
Last case required for prevent double spawn active creature walk far away from spawn point.
* Store phase mask for creatures/gameobjects/corpse in DB
* Propertly set phase for summoned creatures/gameobjects/pets/corpses/spell related dynobjects
* Select proper phase for spawned creature/gameobjects and save it in DB
TODO: in game commands.