Core/Entities: Reworked guid scopes

* Added ObjectGuid traits to easily access whether guid type can be generated globally (ObjectMgr) or not
* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396eb0b
* Added type container visitor for TypeUnorderedMapContainer
* Implemented helper function to erase unique pairs from multimap containers
* Moved object storage of all objects except players and transports to map level
* Added containers linking database spawn id with creature/gameobject in world
* Renamed DBTableGuid to spawnId
* Added a separate spawn id sequence generator for creatures and gameobjects - this will be used in db tables
* Moved building SMSG_UPDATE_OBJECT - updatefields changes broadcast to map update
This commit is contained in:
Shauren
2015-02-25 00:13:14 +01:00
parent 455ef1a64a
commit ca83e14f8b
89 changed files with 1373 additions and 1217 deletions

View File

@@ -3470,14 +3470,14 @@ void SmartScript::GetScript()
SmartAIEventList e;
if (me)
{
e = sSmartScriptMgr->GetScript(-((int32)me->GetDBTableGUIDLow()), mScriptType);
e = sSmartScriptMgr->GetScript(-((int32)me->GetSpawnId()), mScriptType);
if (e.empty())
e = sSmartScriptMgr->GetScript((int32)me->GetEntry(), mScriptType);
FillScript(e, me, NULL);
}
else if (go)
{
e = sSmartScriptMgr->GetScript(-((int32)go->GetDBTableGUIDLow()), mScriptType);
e = sSmartScriptMgr->GetScript(-((int32)go->GetSpawnId()), mScriptType);
if (e.empty())
e = sSmartScriptMgr->GetScript((int32)go->GetEntry(), mScriptType);
FillScript(e, go, NULL);
@@ -3667,5 +3667,12 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry)
Unit* SmartScript::GetLastInvoker()
{
return ObjectAccessor::FindUnit(mLastInvoker);
WorldObject* lookupRoot = me;
if (!lookupRoot)
lookupRoot = go;
if (lookupRoot)
return ObjectAccessor::GetUnit(*lookupRoot, mLastInvoker);
return ObjectAccessor::FindPlayer(mLastInvoker);
}