Change projectiles to use actorIds

deque
scrawl 11 years ago
parent 61187c2fef
commit 1141c1f3f2

@ -2223,7 +2223,7 @@ namespace MWWorld
const Ogre::Vector3& worldPos, const Ogre::Quaternion& orient, MWWorld::Ptr bow, float speed)
{
ProjectileState state;
state.mActorHandle = actor.getRefData().getHandle();
state.mActorId = actor.getClass().getCreatureStats(actor).getActorId();
state.mBow = bow;
state.mVelocity = orient.yAxis() * speed;
@ -2310,7 +2310,7 @@ namespace MWWorld
MagicBoltState state;
state.mSourceName = sourceName;
state.mId = id;
state.mActorHandle = actor.getRefData().getHandle();
state.mActorId = actor.getClass().getCreatureStats(actor).getActorId();
state.mSpeed = speed;
state.mStack = stack;
@ -2374,7 +2374,7 @@ namespace MWWorld
if (obstacle == ptr)
continue;
MWWorld::Ptr caster = searchPtrViaHandle(it->second.mActorHandle);
MWWorld::Ptr caster = searchPtrViaActorId(it->second.mActorId);
// Arrow intersects with player immediately after shooting :/
if (obstacle == caster)
@ -2460,7 +2460,7 @@ namespace MWWorld
if (obstacle == ptr)
continue;
MWWorld::Ptr caster = searchPtrViaHandle(it->second.mActorHandle);
MWWorld::Ptr caster = searchPtrViaActorId(it->second.mActorId);
if (caster.isEmpty())
caster = obstacle;
@ -2483,7 +2483,7 @@ namespace MWWorld
if (explode)
{
MWWorld::Ptr caster = searchPtrViaHandle(it->second.mActorHandle);
MWWorld::Ptr caster = searchPtrViaActorId(it->second.mActorId);
explodeSpell(Ogre::Vector3(ptr.getRefData().getPosition().pos), ptr, it->second.mEffects, caster, it->second.mId, it->second.mSourceName);
deleteObject(ptr);

@ -96,7 +96,7 @@ namespace MWWorld
std::string mId;
// Actor who casted this projectile
std::string mActorHandle;
int mActorId;
// Name of item to display as effect source in magic menu (in case we casted an enchantment)
std::string mSourceName;
@ -111,7 +111,7 @@ namespace MWWorld
struct ProjectileState
{
// Actor who shot this projectile
std::string mActorHandle;
int mActorId;
MWWorld::Ptr mBow; // bow or crossbow the projectile was fired from

Loading…
Cancel
Save