Merge pull request #2484 from Capostrophic/fallbackanim

Allow SwimRunForward state WalkForward fallback (bug #5126)
pull/541/head
Andrei Kortunov 5 years ago committed by GitHub
commit f7917964a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -127,7 +127,9 @@
Bug #5112: Insufficient magicka for current spell not reflected on HUD icon Bug #5112: Insufficient magicka for current spell not reflected on HUD icon
Bug #5123: Script won't run on respawn Bug #5123: Script won't run on respawn
Bug #5124: Arrow remains attached to actor if pulling animation was cancelled Bug #5124: Arrow remains attached to actor if pulling animation was cancelled
Bug #5126: Swimming creatures without RunForward animations are motionless during combat
Bug #5134: Doors rotation by "Lock" console command is inconsistent Bug #5134: Doors rotation by "Lock" console command is inconsistent
Bug #5126: Swimming creatures without RunForward animations are motionless during combat
Bug #5137: Textures with Clamp Mode set to Clamp instead of Wrap are too dark outside the boundaries Bug #5137: Textures with Clamp Mode set to Clamp instead of Wrap are too dark outside the boundaries
Feature #1774: Handle AvoidNode Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI

@ -529,19 +529,7 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
if(!mAnimation->hasAnimation(movementAnimName)) if(!mAnimation->hasAnimation(movementAnimName))
{ {
std::string::size_type swimpos = movementAnimName.find("swim"); std::string::size_type swimpos = movementAnimName.find("swim");
if(swimpos == std::string::npos) if (swimpos != std::string::npos)
{
std::string::size_type runpos = movementAnimName.find("run");
if (runpos != std::string::npos)
{
movementAnimName.replace(runpos, runpos+3, "walk");
if (!mAnimation->hasAnimation(movementAnimName))
movementAnimName.clear();
}
else
movementAnimName.clear();
}
else
{ {
movementAnimName.erase(swimpos, 4); movementAnimName.erase(swimpos, 4);
if (!weapShortGroup.empty()) if (!weapShortGroup.empty())
@ -552,8 +540,18 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
else else
movementAnimName = fallbackShortWeaponGroup(movementAnimName, &movemask); movementAnimName = fallbackShortWeaponGroup(movementAnimName, &movemask);
} }
}
if (!mAnimation->hasAnimation(movementAnimName)) if (swimpos == std::string::npos || !mAnimation->hasAnimation(movementAnimName))
{
std::string::size_type runpos = movementAnimName.find("run");
if (runpos != std::string::npos)
{
movementAnimName.replace(runpos, runpos+3, "walk");
if (!mAnimation->hasAnimation(movementAnimName))
movementAnimName.clear();
}
else
movementAnimName.clear(); movementAnimName.clear();
} }
} }

Loading…
Cancel
Save