1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-25 12:41:01 +00:00

Don't add creature base damage to weapon damage (UESP was wrong)

This commit is contained in:
scrawl 2014-07-20 22:26:26 +02:00
parent 6d794dac69
commit 1636fd66db

View File

@ -308,13 +308,13 @@ namespace MWClass
attack = weapon.get<ESM::Weapon>()->mBase->mData.mThrust; attack = weapon.get<ESM::Weapon>()->mBase->mData.mThrust;
if(attack) if(attack)
{ {
float weaponDamage = attack[0] + ((attack[1]-attack[0])*stats.getAttackStrength()); damage = attack[0] + ((attack[1]-attack[0])*stats.getAttackStrength());
weaponDamage *= 0.5f + (stats.getAttribute(ESM::Attribute::Luck).getModified() / 100.0f); damage *= 0.5f + (stats.getAttribute(ESM::Attribute::Luck).getModified() / 100.0f);
if(weaphashealth) if(weaphashealth)
{ {
int weapmaxhealth = weapon.getClass().getItemMaxHealth(weapon); int weapmaxhealth = weapon.getClass().getItemMaxHealth(weapon);
int weaphealth = weapon.getClass().getItemHealth(weapon); int weaphealth = weapon.getClass().getItemHealth(weapon);
weaponDamage *= float(weaphealth) / weapmaxhealth; damage *= float(weaphealth) / weapmaxhealth;
if (!MWBase::Environment::get().getWorld()->getGodModeState()) if (!MWBase::Environment::get().getWorld()->getGodModeState())
{ {
@ -329,8 +329,6 @@ namespace MWClass
if (weapon.getCellRef().getCharge() == 0) if (weapon.getCellRef().getCharge() == 0)
weapon = *getInventoryStore(ptr).unequipItem(weapon, ptr); weapon = *getInventoryStore(ptr).unequipItem(weapon, ptr);
} }
damage += weaponDamage;
} }
// Apply "On hit" enchanted weapons // Apply "On hit" enchanted weapons