|
|
|
@ -154,21 +154,13 @@ namespace MWClass
|
|
|
|
|
// store
|
|
|
|
|
ptr.getRefData().setCustomData(data.release());
|
|
|
|
|
|
|
|
|
|
getContainerStore(ptr).fill(ref->mBase->mInventory, getId(ptr));
|
|
|
|
|
getContainerStore(ptr).fill(ref->mBase->mInventory, ptr.getCellRef().getRefId());
|
|
|
|
|
|
|
|
|
|
if (hasInventory)
|
|
|
|
|
getInventoryStore(ptr).autoEquip(ptr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string Creature::getId (const MWWorld::Ptr& ptr) const
|
|
|
|
|
{
|
|
|
|
|
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
|
|
|
|
ptr.get<ESM::Creature>();
|
|
|
|
|
|
|
|
|
|
return ref->mBase->mId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const
|
|
|
|
|
{
|
|
|
|
|
MWRender::Objects& objects = renderingInterface.getObjects();
|
|
|
|
@ -335,7 +327,7 @@ namespace MWClass
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!object.isEmpty())
|
|
|
|
|
getCreatureStats(ptr).setLastHitAttemptObject(object.getClass().getId(object));
|
|
|
|
|
getCreatureStats(ptr).setLastHitAttemptObject(object.getCellRef().getRefId());
|
|
|
|
|
|
|
|
|
|
if(setOnPcHitMe && !attacker.isEmpty() && attacker == MWMechanics::getPlayer())
|
|
|
|
|
{
|
|
|
|
@ -353,7 +345,7 @@ namespace MWClass
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!object.isEmpty())
|
|
|
|
|
getCreatureStats(ptr).setLastHitObject(object.getClass().getId(object));
|
|
|
|
|
getCreatureStats(ptr).setLastHitObject(object.getCellRef().getRefId());
|
|
|
|
|
|
|
|
|
|
if (damage > 0.0f && !object.isEmpty())
|
|
|
|
|
MWMechanics::resistNormalWeapon(ptr, attacker, object, damage);
|
|
|
|
@ -571,7 +563,7 @@ namespace MWClass
|
|
|
|
|
|
|
|
|
|
MWWorld::LiveCellRef<ESM::Creature>* ref = ptr.get<ESM::Creature>();
|
|
|
|
|
|
|
|
|
|
const std::string& ourId = (ref->mBase->mOriginal.empty()) ? getId(ptr) : ref->mBase->mOriginal;
|
|
|
|
|
const std::string& ourId = (ref->mBase->mOriginal.empty()) ? ptr.getCellRef().getRefId() : ref->mBase->mOriginal;
|
|
|
|
|
|
|
|
|
|
MWWorld::Store<ESM::SoundGenerator>::iterator sound = store.begin();
|
|
|
|
|
while(sound != store.end())
|
|
|
|
|