[Scummvm-cvs-logs] scummvm master -> acaf8f762382f1aa886d4a3f5b0b8b662863f01c
digitall
digitall at scummvm.org
Thu Jun 14 22:04:32 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
acaf8f7623 TOON: Fix two latent off-by-one errors in Character Class.
Commit: acaf8f762382f1aa886d4a3f5b0b8b662863f01c
https://github.com/scummvm/scummvm/commit/acaf8f762382f1aa886d4a3f5b0b8b662863f01c
Author: D G Turner (digitall at scummvm.org)
Date: 2012-06-14T13:02:44-07:00
Commit Message:
TOON: Fix two latent off-by-one errors in Character Class.
These were exposed by assertions from Common::Array usage.
Changed paths:
engines/toon/character.cpp
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index c9073de..0973062 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -201,7 +201,7 @@ bool Character::walkTo(int16 newPosX, int16 newPosY) {
if (_blockingWalk) {
while ((_x != newPosX || _y != newPosY) && _currentPathNode < _currentPath.size() && !_vm->shouldQuitGame()) {
if (_currentPathNode < _currentPath.size() - 4) {
- int32 delta = MIN<int32>(4, _currentPath.size() - _currentPathNode);
+ int32 delta = MIN<int32>(4, _currentPath.size() - 1 - _currentPathNode);
int16 dx = _currentPath[_currentPathNode+delta].x - _x;
int16 dy = _currentPath[_currentPathNode+delta].y - _y;
@@ -348,7 +348,7 @@ void Character::update(int32 timeIncrement) {
if ((_flags & 0x1) && _currentPath.size() > 0) {
if (_currentPathNode < _currentPath.size()) {
if (_currentPathNode < _currentPath.size() - 10) {
- int32 delta = MIN<int32>(10, _currentPath.size() - _currentPathNode);
+ int32 delta = MIN<int32>(10, _currentPath.size() - 1 - _currentPathNode);
int16 dx = _currentPath[_currentPathNode+delta].x - _x;
int16 dy = _currentPath[_currentPathNode+delta].y - _y;
setFacing(getFacingFromDirection(dx, dy));
More information about the Scummvm-git-logs
mailing list