|
|
|
@ -402,9 +402,10 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
|
|
|
|
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), baseObject.refId, 1);
|
|
|
|
|
MWWorld::Ptr newPtr = ref.getPtr();
|
|
|
|
|
|
|
|
|
|
newPtr.getCellRef().setMpNum(baseObject.mpNum);
|
|
|
|
|
|
|
|
|
|
if (newPtr.getClass().isActor())
|
|
|
|
|
{
|
|
|
|
|
newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, cellStore, baseObject.position);
|
|
|
|
|
MWMechanics::CreatureStats& creatureStats = newPtr.getClass().getCreatureStats(newPtr);
|
|
|
|
|
|
|
|
|
|
if (baseObject.isSummon)
|
|
|
|
|
{
|
|
|
|
@ -420,7 +421,7 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
|
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "-- Actor has master: %s", masterPtr.getCellRef().getRefId().c_str());
|
|
|
|
|
|
|
|
|
|
MWMechanics::AiFollow package(masterPtr);
|
|
|
|
|
newPtr.getClass().getCreatureStats(newPtr).getAiSequence().stack(package, newPtr);
|
|
|
|
|
creatureStats.getAiSequence().stack(package, newPtr);
|
|
|
|
|
|
|
|
|
|
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(newPtr);
|
|
|
|
|
if (anim)
|
|
|
|
@ -438,6 +439,9 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "-- Cannot spawn non-actor object!");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "-- Actor already existed!");
|
|
|
|
|
}
|
|
|
|
|