1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-18 13:06:45 +00:00

Merge pull request #2610 from akortunov/warnfix2

Fix some build warnings
This commit is contained in:
Bret Curtis 2019-11-27 21:24:44 +01:00 committed by GitHub
commit 62b9f1a2f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 57 deletions

View file

@ -1773,6 +1773,9 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
0, mAttackType+" min attack", mAttackType+" max attack", 0.999f, 0);
break;
case UpperCharState_StartToMinAttack:
case UpperCharState_MaxAttackToMinHit:
{
if (mUpperBodyState == UpperCharState_StartToMinAttack)
{
// If actor is already stopped preparing attack, do not play the "min attack -> max attack" part.
// Happens if the player did not hold the attack button.
@ -1788,8 +1791,7 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
}
playSwishSound(0.0f);
}
// Fall-through
case UpperCharState_MaxAttackToMinHit:
if(mAttackType == "shoot")
{
start = mAttackType+" min hit";
@ -1802,6 +1804,7 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
}
mUpperBodyState = UpperCharState_MinHitToHit;
break;
}
case UpperCharState_MinHitToHit:
if(mAttackType == "shoot")
{

View file

@ -131,30 +131,21 @@ namespace MWMechanics
mPrev = pos;
switch(mWalkState)
{
case State_Norm:
{
if(!samePosition)
break;
else
mWalkState = State_CheckStuck;
}
/* FALL THROUGH */
case State_CheckStuck:
if (mWalkState != State_Evade)
{
if(!samePosition)
{
mWalkState = State_Norm;
mStuckDuration = 0;
break;
mEvadeDuration = 0;
return;
}
else
{
mWalkState = State_CheckStuck;
mStuckDuration += duration;
// consider stuck only if position unchanges for a period
if(mStuckDuration < DURATION_SAME_SPOT)
break; // still checking, note duration added to timer
return; // still checking, note duration added to timer
else
{
mStuckDuration = 0;
@ -162,10 +153,7 @@ namespace MWMechanics
chooseEvasionDirection();
}
}
}
/* FALL THROUGH */
case State_Evade:
{
mEvadeDuration += duration;
if(mEvadeDuration >= DURATION_TO_EVADE)
{
@ -174,9 +162,6 @@ namespace MWMechanics
mEvadeDuration = 0;
}
}
/* NO DEFAULT CASE */
}
}
void ObstacleCheck::takeEvasiveAction(MWMechanics::Movement& actorMovement) const
{

View file

@ -148,7 +148,7 @@ namespace ICS
float step = FromString<float>(xmlInterval->Attribute("step"));
ICS_LOG("Applying Bezier filter to channel [number="
+ ToString<int>(ch) + ", startX="
+ ToString<size_t>(ch) + ", startX="
+ ToString<float>(startX) + ", startY="
+ ToString<float>(startY) + ", midX="
+ ToString<float>(midX) + ", midY="