Disable fProjectileThrownStoreChance when shooting at player (Fixes #1490)

This commit is contained in:
scrawl 2014-06-15 16:00:29 +02:00
parent fd59a4a79e
commit a0f9a6718f

View file

@ -231,9 +231,13 @@ namespace MWMechanics
if (damage > 0) if (damage > 0)
MWBase::Environment::get().getWorld()->spawnBloodEffect(victim, hitPosition); MWBase::Environment::get().getWorld()->spawnBloodEffect(victim, hitPosition);
float fProjectileThrownStoreChance = gmst.find("fProjectileThrownStoreChance")->getFloat(); // Arrows shot at enemies have a chance to turn up in their inventory
if ((::rand()/(RAND_MAX+1.0)) < fProjectileThrownStoreChance/100.f) if (victim != MWBase::Environment::get().getWorld()->getPlayerPtr())
victim.getClass().getContainerStore(victim).add(projectile, 1, victim); {
float fProjectileThrownStoreChance = gmst.find("fProjectileThrownStoreChance")->getFloat();
if ((::rand()/(RAND_MAX+1.0)) < fProjectileThrownStoreChance/100.f)
victim.getClass().getContainerStore(victim).add(projectile, 1, victim);
}
victim.getClass().onHit(victim, damage, true, projectile, attacker, true); victim.getClass().onHit(victim, damage, true, projectile, attacker, true);
} }