diff options
author | Le Philousophe | 2019-05-13 23:54:19 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-06-01 22:43:48 +0200 |
commit | 6e0e3bb6b1cebfccb020fbe9696fb7d49f2e8fc4 (patch) | |
tree | 3749d66e1daaae2e472dd130ee2579d34800c667 | |
parent | 2ed2d617c09572a4bed3a9c9e2c808789024ebee (diff) | |
download | scummvm-rg350-6e0e3bb6b1cebfccb020fbe9696fb7d49f2e8fc4.tar.gz scummvm-rg350-6e0e3bb6b1cebfccb020fbe9696fb7d49f2e8fc4.tar.bz2 scummvm-rg350-6e0e3bb6b1cebfccb020fbe9696fb7d49f2e8fc4.zip |
CRYOMNI3D: Don't abort when there is no transition defined
-rw-r--r-- | engines/cryomni3d/versailles/engine.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp index 46d308fe89..eb3f030bac 100644 --- a/engines/cryomni3d/versailles/engine.cpp +++ b/engines/cryomni3d/versailles/engine.cpp @@ -966,7 +966,7 @@ void CryOmni3DEngine_Versailles::executeTransition(unsigned int nextPlaceId) { _nextPlaceId = nextPlaceId; - Common::String animation = transition->animations[animationId]; + Common::String animation = animationId == -1u ? "" : transition->animations[animationId]; animation.toUppercase(); debug("Transition animation: %s", animation.c_str()); if (animation.hasPrefix("NOT_FLI")) { @@ -1015,7 +1015,7 @@ void CryOmni3DEngine_Versailles::executeTransition(unsigned int nextPlaceId) { unsigned int nextNextPlaceId = nextPlace->transitions[transitionNum].dstId; animationId = determineTransitionAnimation(nextPlaceId, nextNextPlaceId, &transition); - animation = transition->animations[animationId]; + animation = animationId == -1u ? "" : transition->animations[animationId]; animation.toUppercase(); if (animation.hasPrefix("NOT_FLI")) { @@ -1074,7 +1074,11 @@ unsigned int CryOmni3DEngine_Versailles::determineTransitionAnimation(unsigned i error("Invalid dst state"); } - if (animsNum <= 1) { + if (animsNum == 0) { + return -1; + } + + if (animsNum == 1) { return 0; } |