|
|
|
@ -184,6 +184,39 @@ void WeaponAnimation::releaseArrow(MWWorld::Ptr actor, float attackStrength)
|
|
|
|
|
return;
|
|
|
|
|
osg::Vec3f launchPos = osg::computeLocalToWorld(nodepaths[0]).getTrans();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
|
|
If the actor shooting this is a LocalPlayer or LocalActor, track their projectile origin so it can be sent
|
|
|
|
|
in the next PlayerAttack or ActorAttack packet
|
|
|
|
|
|
|
|
|
|
Otherwise, set the projectileOrigin for a DedicatedPlayer or DedicatedActor
|
|
|
|
|
*/
|
|
|
|
|
if (localAttack)
|
|
|
|
|
{
|
|
|
|
|
localAttack->projectileOrigin.origin[0] = launchPos.x();
|
|
|
|
|
localAttack->projectileOrigin.origin[1] = launchPos.y();
|
|
|
|
|
localAttack->projectileOrigin.origin[2] = launchPos.z();
|
|
|
|
|
localAttack->projectileOrigin.orientation[0] = orient.x();
|
|
|
|
|
localAttack->projectileOrigin.orientation[1] = orient.y();
|
|
|
|
|
localAttack->projectileOrigin.orientation[2] = orient.z();
|
|
|
|
|
localAttack->projectileOrigin.orientation[3] = orient.w();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mwmp::Attack* dedicatedAttack = MechanicsHelper::getDedicatedAttack(actor);
|
|
|
|
|
|
|
|
|
|
if (dedicatedAttack)
|
|
|
|
|
{
|
|
|
|
|
launchPos = osg::Vec3f(dedicatedAttack->projectileOrigin.origin[0], dedicatedAttack->projectileOrigin.origin[1], dedicatedAttack->projectileOrigin.origin[2]);
|
|
|
|
|
orient = osg::Quat(dedicatedAttack->projectileOrigin.orientation[0], dedicatedAttack->projectileOrigin.orientation[1], dedicatedAttack->projectileOrigin.orientation[2],
|
|
|
|
|
dedicatedAttack->projectileOrigin.orientation[3]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
End of tes3mp addition
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
float fThrownWeaponMinSpeed = gmst.find("fThrownWeaponMinSpeed")->mValue.getFloat();
|
|
|
|
|
float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->mValue.getFloat();
|
|
|
|
|
float speed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * attackStrength;
|
|
|
|
@ -222,6 +255,39 @@ void WeaponAnimation::releaseArrow(MWWorld::Ptr actor, float attackStrength)
|
|
|
|
|
return;
|
|
|
|
|
osg::Vec3f launchPos = osg::computeLocalToWorld(nodepaths[0]).getTrans();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
|
|
If the actor shooting this is a LocalPlayer or LocalActor, track their projectile origin so it can be sent
|
|
|
|
|
in the next PlayerAttack or ActorAttack packet
|
|
|
|
|
|
|
|
|
|
Otherwise, set the projectileOrigin for a DedicatedPlayer or DedicatedActor
|
|
|
|
|
*/
|
|
|
|
|
if (localAttack)
|
|
|
|
|
{
|
|
|
|
|
localAttack->projectileOrigin.origin[0] = launchPos.x();
|
|
|
|
|
localAttack->projectileOrigin.origin[1] = launchPos.y();
|
|
|
|
|
localAttack->projectileOrigin.origin[2] = launchPos.z();
|
|
|
|
|
localAttack->projectileOrigin.orientation[0] = orient.x();
|
|
|
|
|
localAttack->projectileOrigin.orientation[1] = orient.y();
|
|
|
|
|
localAttack->projectileOrigin.orientation[2] = orient.z();
|
|
|
|
|
localAttack->projectileOrigin.orientation[3] = orient.w();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mwmp::Attack* dedicatedAttack = MechanicsHelper::getDedicatedAttack(actor);
|
|
|
|
|
|
|
|
|
|
if (dedicatedAttack)
|
|
|
|
|
{
|
|
|
|
|
launchPos = osg::Vec3f(dedicatedAttack->projectileOrigin.origin[0], dedicatedAttack->projectileOrigin.origin[1], dedicatedAttack->projectileOrigin.origin[2]);
|
|
|
|
|
orient = osg::Quat(dedicatedAttack->projectileOrigin.orientation[0], dedicatedAttack->projectileOrigin.orientation[1], dedicatedAttack->projectileOrigin.orientation[2],
|
|
|
|
|
dedicatedAttack->projectileOrigin.orientation[3]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
End of tes3mp addition
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
float fProjectileMinSpeed = gmst.find("fProjectileMinSpeed")->mValue.getFloat();
|
|
|
|
|
float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->mValue.getFloat();
|
|
|
|
|
float speed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * attackStrength;
|
|
|
|
|