mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-27 10:11:34 +00:00
Merge branch 'block' into 'master'
Blocking animation and sound fixes (bug #6645) Closes #6645 See merge request OpenMW/openmw!2500
This commit is contained in:
commit
7496217986
4 changed files with 16 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
Bug #5714: Touch spells cast using ExplodeSpell don't always explode
|
Bug #5714: Touch spells cast using ExplodeSpell don't always explode
|
||||||
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
||||||
Bug #6427: Enemy health bar disappears before damaging effect ends
|
Bug #6427: Enemy health bar disappears before damaging effect ends
|
||||||
|
Bug #6645: Enemy block sounds align with animation instead of blocked hits
|
||||||
Bug #6661: Saved games that have no preview screenshot cause issues or crashes
|
Bug #6661: Saved games that have no preview screenshot cause issues or crashes
|
||||||
Bug #6939: OpenMW-CS: ID columns are too short
|
Bug #6939: OpenMW-CS: ID columns are too short
|
||||||
Bug #6949: Sun Damage effect doesn't work in quasi exteriors
|
Bug #6949: Sun Damage effect doesn't work in quasi exteriors
|
||||||
|
|
|
@ -355,7 +355,10 @@ namespace MWClass
|
||||||
MWMechanics::applyElementalShields(ptr, victim);
|
MWMechanics::applyElementalShields(ptr, victim);
|
||||||
|
|
||||||
if (MWMechanics::blockMeleeAttack(ptr, victim, weapon, damage, attackStrength))
|
if (MWMechanics::blockMeleeAttack(ptr, victim, weapon, damage, attackStrength))
|
||||||
|
{
|
||||||
damage = 0;
|
damage = 0;
|
||||||
|
block(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
MWMechanics::diseaseContact(victim, ptr);
|
MWMechanics::diseaseContact(victim, ptr);
|
||||||
|
|
||||||
|
|
|
@ -700,7 +700,10 @@ namespace MWClass
|
||||||
MWMechanics::applyElementalShields(ptr, victim);
|
MWMechanics::applyElementalShields(ptr, victim);
|
||||||
|
|
||||||
if (MWMechanics::blockMeleeAttack(ptr, victim, weapon, damage, attackStrength))
|
if (MWMechanics::blockMeleeAttack(ptr, victim, weapon, damage, attackStrength))
|
||||||
|
{
|
||||||
damage = 0;
|
damage = 0;
|
||||||
|
block(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
if (victim == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState())
|
if (victim == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState())
|
||||||
damage = 0;
|
damage = 0;
|
||||||
|
|
|
@ -385,9 +385,17 @@ namespace MWMechanics
|
||||||
bool knockout = stats.getFatigue().getCurrent() < 0 || stats.getFatigue().getBase() == 0;
|
bool knockout = stats.getFatigue().getCurrent() < 0 || stats.getFatigue().getBase() == 0;
|
||||||
bool recovery = stats.getHitRecovery();
|
bool recovery = stats.getHitRecovery();
|
||||||
bool knockdown = stats.getKnockedDown();
|
bool knockdown = stats.getKnockedDown();
|
||||||
bool block = stats.getBlock();
|
bool block = stats.getBlock() && !knockout && !recovery && !knockdown;
|
||||||
bool isSwimming = world->isSwimming(mPtr);
|
bool isSwimming = world->isSwimming(mPtr);
|
||||||
|
|
||||||
|
stats.setBlock(false);
|
||||||
|
|
||||||
|
if (mPtr == getPlayer() && mHitState == CharState_Block && block)
|
||||||
|
{
|
||||||
|
mHitState = CharState_None;
|
||||||
|
resetCurrentIdleState();
|
||||||
|
}
|
||||||
|
|
||||||
if (mHitState != CharState_None)
|
if (mHitState != CharState_None)
|
||||||
{
|
{
|
||||||
if (!mAnimation->isPlaying(mCurrentHit))
|
if (!mAnimation->isPlaying(mCurrentHit))
|
||||||
|
@ -396,7 +404,6 @@ namespace MWMechanics
|
||||||
mCurrentHit.clear();
|
mCurrentHit.clear();
|
||||||
stats.setKnockedDown(false);
|
stats.setKnockedDown(false);
|
||||||
stats.setHitRecovery(false);
|
stats.setHitRecovery(false);
|
||||||
stats.setBlock(false);
|
|
||||||
resetCurrentIdleState();
|
resetCurrentIdleState();
|
||||||
}
|
}
|
||||||
else if (isKnockedOut())
|
else if (isKnockedOut())
|
||||||
|
@ -451,7 +458,6 @@ namespace MWMechanics
|
||||||
mCurrentHit.clear();
|
mCurrentHit.clear();
|
||||||
stats.setKnockedDown(false);
|
stats.setKnockedDown(false);
|
||||||
stats.setHitRecovery(false);
|
stats.setHitRecovery(false);
|
||||||
stats.setBlock(false);
|
|
||||||
resetCurrentIdleState();
|
resetCurrentIdleState();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1145,8 +1151,6 @@ namespace MWMechanics
|
||||||
mCastingManualSpell = false;
|
mCastingManualSpell = false;
|
||||||
mCanCast = false;
|
mCanCast = false;
|
||||||
}
|
}
|
||||||
else if (groupname == "shield" && action == "block hit")
|
|
||||||
charClass.block(mPtr);
|
|
||||||
else if (groupname == "containeropen" && action == "loot")
|
else if (groupname == "containeropen" && action == "loot")
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container, mPtr);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container, mPtr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue