aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-19 21:00:37 -0400
committerPaul Gilbert2018-03-19 21:00:37 -0400
commit0a20df925912bf76c0f49c70f8e9a7e1979f374a (patch)
treea8924db1588177acbb9af519682d3afae1c38f6e
parent5645d63acdac555d987cb106bf1e84182c7ae52e (diff)
downloadscummvm-rg350-0a20df925912bf76c0f49c70f8e9a7e1979f374a.tar.gz
scummvm-rg350-0a20df925912bf76c0f49c70f8e9a7e1979f374a.tar.bz2
scummvm-rg350-0a20df925912bf76c0f49c70f8e9a7e1979f374a.zip
XEEN: Fix setSpeedTable crash after missed ranged attack
-rw-r--r--engines/xeen/combat.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 044b650965..6c337c1150 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -1114,7 +1114,9 @@ void Combat::setSpeedTable() {
}
if (hasSpeed) {
- if (_whosSpeed >= (int)_speedTable.size() || _speedTable[_whosSpeed] != oldSpeed) {
+ if (_speedTable.empty()) {
+ _whosSpeed = 0;
+ } else if (_whosSpeed >= (int)_speedTable.size() || _speedTable[_whosSpeed] != oldSpeed) {
for (_whosSpeed = 0; _whosSpeed < (int)charSpeeds.size(); ++_whosSpeed) {
if (oldSpeed == _speedTable[_whosSpeed])
break;