[Scummvm-git-logs] scummvm master -> 50e87bd252c9689fdfeb59f1fba6950a6a4a69ce

sev- noreply at scummvm.org
Tue Apr 15 07:34:07 UTC 2025


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
9cb2a84cad QDENGINE: Fix inventory bug in karliknos
5294a11024 QDENGINE: Remove !ignore_personages for older game versions
50f45046a4 QDENGINE: Add contour mask
8ae4db4559 QDENGINE: Fix impassable grid bug in pilots3
feb517a6a4 QDENGINE: Update game version cutoff dates
d8478e5512 QDENGINE: Fix inventory being drawn in main menu
50e87bd252 QDENGINE: Fix zigzag pattern in character's path for older games


Commit: 9cb2a84cad2528a258d42bb7cb1bba388381d53a
    https://github.com/scummvm/scummvm/commit/9cb2a84cad2528a258d42bb7cb1bba388381d53a
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Fix inventory bug in karliknos

Changed paths:
    engines/qdengine/qdcore/qd_game_dispatcher.cpp


diff --git a/engines/qdengine/qdcore/qd_game_dispatcher.cpp b/engines/qdengine/qdcore/qd_game_dispatcher.cpp
index 7e74a5609f1..3551cf76550 100644
--- a/engines/qdengine/qdcore/qd_game_dispatcher.cpp
+++ b/engines/qdengine/qdcore/qd_game_dispatcher.cpp
@@ -2052,7 +2052,8 @@ bool qdGameDispatcher::toggle_inventory(bool state) {
 		}
 	}
 
-	_cur_inventory = NULL;
+	if (g_engine->_gameVersion > 20031206 || !state)
+		_cur_inventory = NULL;
 	update_ingame_interface();
 	return true;
 }


Commit: 5294a11024dcb183758c63772889488db8d8cb33
    https://github.com/scummvm/scummvm/commit/5294a11024dcb183758c63772889488db8d8cb33
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Remove !ignore_personages for older game versions

Changed paths:
    engines/qdengine/qdcore/qd_camera.cpp


diff --git a/engines/qdengine/qdcore/qd_camera.cpp b/engines/qdengine/qdcore/qd_camera.cpp
index 768f07650cd..61bdc7dcbd7 100644
--- a/engines/qdengine/qdcore/qd_camera.cpp
+++ b/engines/qdengine/qdcore/qd_camera.cpp
@@ -1300,7 +1300,7 @@ bool qdCamera::is_walkable(const Vect2s &center_pos, const Vect2s &size, bool ig
 	debugC(3, kDebugMovement, "qdCamera::is_walkable(): attr: %d [%d, %d] size: [%d, %d], ignore_personages: %d", cells->attributes(), x0, y0, size.x, size.y, ignore_personages);
 
 	int attr = sGridCell::CELL_IMPASSABLE | sGridCell::CELL_OCCUPIED;
-	if (!ignore_personages) {
+	if (g_engine->_gameVersion > 20031206 && !ignore_personages) {
 		attr |= sGridCell::CELL_PERSONAGE_OCCUPIED;
 	 }
 


Commit: 50f45046a48175dacc638c7602b4de3f33703197
    https://github.com/scummvm/scummvm/commit/50f45046a48175dacc638c7602b4de3f33703197
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Add contour mask

Changed paths:
    engines/qdengine/qdcore/qd_contour.cpp
    engines/qdengine/qdcore/qd_contour.h


diff --git a/engines/qdengine/qdcore/qd_contour.cpp b/engines/qdengine/qdcore/qd_contour.cpp
index 3253b5d1afc..4bc2c8ab5df 100644
--- a/engines/qdengine/qdcore/qd_contour.cpp
+++ b/engines/qdengine/qdcore/qd_contour.cpp
@@ -33,7 +33,8 @@ qdContour::qdContour(qdContourType tp) : _contour_type(tp),
 
 qdContour::qdContour(const qdContour &ct) : _contour_type(ct._contour_type),
 	_size(ct._size),
-	_contour(ct._contour) {
+	_contour(ct._contour),
+	_mask(ct._mask) {
 	_mask_pos = ct._mask_pos;
 }
 
@@ -48,6 +49,8 @@ qdContour &qdContour::operator = (const qdContour &ct) {
 	_size = ct._size;
 	_mask_pos = ct._mask_pos;
 
+	_mask = ct._mask;
+
 	_contour = ct._contour;
 
 	return *this;
@@ -82,6 +85,73 @@ bool qdContour::update_contour_point(const Vect2s &pt, int pos) {
 	return false;
 }
 
+void qdContour::createMaskOld(int x0, int y0, int x1, int y1) {
+	_mask.resize(_size.x * _size.y);
+	Common::fill(_mask.begin(), _mask.end(), 0);
+
+	Std::vector<int> intersections;
+	intersections.reserve(_contour.size());
+
+	Std::vector<byte>::iterator it = _mask.begin();
+	for (int y = y0; y <= y1; y++) {
+		byte *ptr = &*it;
+
+		for (int i = 0; i < _contour.size(); i++) {
+			Vect2s p0 = _contour[i];
+			Vect2s p1 = (i < _contour.size() - 1) ? _contour[i + 1] : _contour[0];
+
+			if (p0.y != p1.y) {
+				if (((p0.y << 2) <= (y << 2) + 2 && (p1.y << 2) >= (y << 2) + 2) || ((p0.y << 2) >= (y << 2) + 2 && (p1.y << 2) <= (y << 2) + 2))
+					intersections.push_back((y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y) + p0.x);
+			}
+		}
+
+		if (intersections.size() > 1) {
+			Common::sort(intersections.begin(), intersections.end());
+			for (int i = 0; i < intersections.size() - 1; i += 2) {
+				int xl = intersections[i];
+				int xr = intersections[i + 1];
+
+				if (xr > xl) {
+					byte *p = ptr + xl - x0;
+					for (int col = xl; col <= xr; col++)
+						*p++ = true;
+				}
+			}
+		}
+
+		intersections.clear();
+
+		for (int i = 0; i < _contour.size(); i++) {
+			Vect2s p0 = _contour[i];
+			Vect2s p1 = (i < _contour.size() - 1) ? _contour[i + 1] : _contour[0];
+
+			if (p0.y != p1.y) {
+				if (((p0.y << 2) <= (y << 2) - 2 && (p1.y << 2) >= (y << 2) - 2) || ((p0.y << 2) >= (y << 2) - 2 && (p1.y << 2) <= (y << 2) - 2))
+					intersections.push_back((y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y) + p0.x);
+			}
+		}
+
+		if (intersections.size() > 1) {
+			Common::sort(intersections.begin(), intersections.end());
+			for (int i = 0; i < intersections.size() - 1; i += 2) {
+				int xl = intersections[i];
+				int xr = intersections[i + 1];
+
+				if (xr > xl) {
+					byte *p = ptr + xl - x0;
+					for (int col = xl; col <= xr; col++)
+						*p++ = true;
+				}
+			}
+		}
+
+		intersections.clear();
+
+		it += _size.x;
+	}
+}
+
 bool qdContour::update_contour() {
 	if (_contour_type != CONTOUR_POLYGON) return false;
 
@@ -103,6 +173,9 @@ bool qdContour::update_contour() {
 	_size = Vect2s(x1 - x0 + 1, y1 - y0 + 1);
 	_mask_pos = Vect2s(x0 + _size.x / 2, y0 + _size.y / 2);
 
+	if (g_engine->_gameVersion <= 20050101)
+		createMaskOld(x0, y0, x1, y1);
+
 	return true;
 }
 
diff --git a/engines/qdengine/qdcore/qd_contour.h b/engines/qdengine/qdcore/qd_contour.h
index fd7e2d60e4b..8f31ba7c802 100644
--- a/engines/qdengine/qdcore/qd_contour.h
+++ b/engines/qdengine/qdcore/qd_contour.h
@@ -111,6 +111,12 @@ public:
 		return _contour[pos];
 	}
 
+	void createMaskOld(int x0, int y0, int x1, int y1);
+
+	const byte *maskData() const {
+		return &*_mask.begin();
+	}
+
 	//! Возвращает размеры маски.
 	const Vect2s &mask_size() const {
 		return _size;
@@ -153,6 +159,8 @@ private:
 
 	Vect2s _mask_pos;
 
+	Std::vector<byte> _mask;
+
 	//! Контур.
 	/**
 	Произвольный замкнутый контур. Задается для CONTOUR_POLYGON.


Commit: 8ae4db4559ac41ca061e43e9b047d27a768dbc71
    https://github.com/scummvm/scummvm/commit/8ae4db4559ac41ca061e43e9b047d27a768dbc71
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Fix impassable grid bug in pilots3

Changed paths:
    engines/qdengine/qdcore/qd_contour.cpp
    engines/qdengine/qdcore/qd_grid_zone.cpp


diff --git a/engines/qdengine/qdcore/qd_contour.cpp b/engines/qdengine/qdcore/qd_contour.cpp
index 4bc2c8ab5df..427747b7f4a 100644
--- a/engines/qdengine/qdcore/qd_contour.cpp
+++ b/engines/qdengine/qdcore/qd_contour.cpp
@@ -190,52 +190,62 @@ bool qdContour::is_inside(const Vect2s &pos) const {
 			return true;
 		break;
 	case CONTOUR_POLYGON: {
-		Vect2s p = pos;
-		int intersections_lt0 = 0;
-		int intersections_gt0 = 0;
-		int intersections_lt1 = 0;
-		int intersections_gt1 = 0;
-		for (uint i = 0; i < _contour.size(); i ++) {
-			Vect2s p0 = _contour[i];
-			Vect2s p1 = (i < _contour.size() - 1) ? _contour[i + 1] : _contour[0];
-			if (p0.y != p1.y) {
-				if ((p0.y < p.y && p1.y >= p.y) || (p0.y >= p.y && p1.y < p.y)) {
-					if (p0.x < p.x && p1.x < p.x)
-						intersections_lt0++;
-					else if (p0.x > p.x && p1.x > p.x)
-						intersections_gt0++;
-					else {
-						int x = (p.y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y) + p0.x;
-
-						if (x == p.x)
-							return true;
-						else if (x > p.x)
-							intersections_gt0++;
-						else
+		if (g_engine->_gameVersion > 20050101) {
+			Vect2s p = pos;
+			int intersections_lt0 = 0;
+			int intersections_gt0 = 0;
+			int intersections_lt1 = 0;
+			int intersections_gt1 = 0;
+			for (uint i = 0; i < _contour.size(); i ++) {
+				Vect2s p0 = _contour[i];
+				Vect2s p1 = (i < _contour.size() - 1) ? _contour[i + 1] : _contour[0];
+				if (p0.y != p1.y) {
+					if ((p0.y < p.y && p1.y >= p.y) || (p0.y >= p.y && p1.y < p.y)) {
+						if (p0.x < p.x && p1.x < p.x)
 							intersections_lt0++;
+						else if (p0.x > p.x && p1.x > p.x)
+							intersections_gt0++;
+						else {
+							int x = (p.y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y) + p0.x;
+
+							if (x == p.x)
+								return true;
+							else if (x > p.x)
+								intersections_gt0++;
+							else
+								intersections_lt0++;
+						}
 					}
-				}
-				if ((p0.y <= p.y && p1.y > p.y) || (p0.y > p.y && p1.y <= p.y)) {
-					if (p0.x < p.x && p1.x < p.x)
-						intersections_lt1++;
-					else if (p0.x > p.x && p1.x > p.x)
-						intersections_gt1++;
-					else {
-						int x = (p.y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y) + p0.x;
-
-						if (x == p.x)
-							return true;
-						else if (x > p.x)
-							intersections_gt1++;
-						else
+					if ((p0.y <= p.y && p1.y > p.y) || (p0.y > p.y && p1.y <= p.y)) {
+						if (p0.x < p.x && p1.x < p.x)
 							intersections_lt1++;
+						else if (p0.x > p.x && p1.x > p.x)
+							intersections_gt1++;
+						else {
+							int x = (p.y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y) + p0.x;
+
+							if (x == p.x)
+								return true;
+							else if (x > p.x)
+								intersections_gt1++;
+							else
+								intersections_lt1++;
+						}
 					}
 				}
 			}
-		}
 
-		return ((intersections_lt0 & 1) && intersections_gt0 != 0) ||
-		       ((intersections_lt1 & 1) && intersections_gt1 != 0);
+			return ((intersections_lt0 & 1) && intersections_gt0 != 0) ||
+				   ((intersections_lt1 & 1) && intersections_gt1 != 0);
+		} else {
+			Vect2s p = pos - _mask_pos;
+			p.x += _size.x / 2;
+			p.y += _size.y / 2;
+			if (p.x >= 0 && p.x < _size.x && p.y >= 0 && p.y < _size.y) {
+				if (_mask[p.x + p.y * _size.x])
+					return true;
+			}
+		}
 		break;
 	}
 }
diff --git a/engines/qdengine/qdcore/qd_grid_zone.cpp b/engines/qdengine/qdcore/qd_grid_zone.cpp
index 2caa4c61264..e18227d7893 100644
--- a/engines/qdengine/qdcore/qd_grid_zone.cpp
+++ b/engines/qdengine/qdcore/qd_grid_zone.cpp
@@ -192,14 +192,13 @@ bool qdGridZone::apply_zone() const {
 	pos.x -= mask_size().x / 2;
 	pos.y -= mask_size().y / 2;
 
-//	const byte* mask_ptr = mask_data();
+	const byte* mask_ptr = maskData();
 
 	if (_state) {
 		for (int y = 0; y < mask_size().y; y++) {
 			for (int x = 0; x < mask_size().x; x++) {
-				if (is_inside(pos + Vect2s(x, y))) {
-//				if(*mask_ptr++){
-					if (sGridCell * p = camera->get_cell(pos + Vect2s(x, y))) {
+				if ((g_engine->_gameVersion <= 20050101 && *mask_ptr++) || is_inside(pos + Vect2s(x, y))) {
+					if (sGridCell *p = camera->get_cell(pos + Vect2s(x, y))) {
 						p->make_walkable();
 						p->set_height(_height);
 					}
@@ -209,8 +208,7 @@ bool qdGridZone::apply_zone() const {
 	} else {
 		for (int y = 0; y < mask_size().y; y++) {
 			for (int x = 0; x < mask_size().x; x++) {
-				if (is_inside(pos + Vect2s(x, y))) {
-//				if(*mask_ptr++){
+				if ((g_engine->_gameVersion <= 20050101 && *mask_ptr++) || is_inside(pos + Vect2s(x, y))) {
 					if (sGridCell * p = camera->get_cell(pos + Vect2s(x, y))) {
 						p->make_impassable();
 						p->set_height(0);
@@ -248,14 +246,13 @@ bool qdGridZone::select(qdCamera *camera, bool bSelect) const {
 	pos.x -= mask_size().x / 2;
 	pos.y -= mask_size().y / 2;
 
-//	const byte* mask_ptr = mask_data();
+	const byte* mask_ptr = maskData();
 
 	if (bSelect) {
 		for (int y = 0; y < mask_size().y; y++) {
 			for (int x = 0; x < mask_size().x; x++) {
-				if (is_inside(pos + Vect2s(x, y))) {
-//				if(*mask_ptr++){
-					if (sGridCell * p = camera->get_cell(pos + Vect2s(x, y)))
+				if ((g_engine->_gameVersion <= 20050101 && *mask_ptr++) || is_inside(pos + Vect2s(x, y))) {
+					if (sGridCell *p = camera->get_cell(pos + Vect2s(x, y)))
 						p->select();
 				}
 			}
@@ -263,8 +260,7 @@ bool qdGridZone::select(qdCamera *camera, bool bSelect) const {
 	} else {
 		for (int y = 0; y < mask_size().y; y++) {
 			for (int x = 0; x < mask_size().x; x++) {
-				if (is_inside(pos + Vect2s(x, y))) {
-//				if(*mask_ptr++){
+				if ((g_engine->_gameVersion <= 20050101 && *mask_ptr++) || is_inside(pos + Vect2s(x, y))) {
 					if (sGridCell * p = camera->get_cell(pos + Vect2s(x, y)))
 						p->deselect();
 				}


Commit: feb517a6a4db4ca1db1642304647993d818b208c
    https://github.com/scummvm/scummvm/commit/feb517a6a4db4ca1db1642304647993d818b208c
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Update game version cutoff dates

Changed paths:
    engines/qdengine/qdcore/qd_game_object_moving.cpp


diff --git a/engines/qdengine/qdcore/qd_game_object_moving.cpp b/engines/qdengine/qdcore/qd_game_object_moving.cpp
index b41f5821b6d..9a3b25daea5 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_moving.cpp
@@ -79,7 +79,7 @@ qdGameObjectMoving::qdGameObjectMoving() :
 	_is_selected = false;
 	set_flag(QD_OBJ_HAS_BOUND_FLAG);
 
-	if (g_engine->_gameVersion <= 20030919)
+	if (g_engine->_gameVersion <= 20060129)
 		_movement_mode = MOVEMENT_MODE_NONE_EARLY;
 	else
 		_movement_mode = MOVEMENT_MODE_STOP;
@@ -121,7 +121,7 @@ qdGameObjectMoving::qdGameObjectMoving(const qdGameObjectMoving &obj) : qdGameOb
 	_is_selected = false;
 	set_flag(QD_OBJ_HAS_BOUND_FLAG);
 
-	if (g_engine->_gameVersion <= 20030919)
+	if (g_engine->_gameVersion <= 20060129)
 		_movement_mode = MOVEMENT_MODE_NONE_EARLY;
 	else
 		_movement_mode = MOVEMENT_MODE_STOP;
@@ -532,7 +532,7 @@ bool qdGameObjectMoving::stop_movement() {
 		if (cur_state() == -1) return true;
 
 		qdGameObjectState *st = get_state(cur_state());
-		if (g_engine->_gameVersion <= 20030919) {
+		if (g_engine->_gameVersion <= 20060129) {
 			if (st->state_type() == qdGameObjectState::STATE_WALK) {
 				set_animation_info(static_cast<qdGameObjectStateWalk *>(st)->static_animation_info(_direction_angle));
 				st->stop_sound();
@@ -734,7 +734,7 @@ Vect3f qdGameObjectMoving::get_future_r(float dt, bool &end_movement, bool real_
 			}
 		}
 		return R();
-	case MOVEMENT_MODE_NONE_EARLY: // _gameVersion <= 20030919
+	case MOVEMENT_MODE_NONE_EARLY: // _gameVersion <= 20060129
 	default:
 		break;
 	}
@@ -877,7 +877,7 @@ void qdGameObjectMoving::quant(float dt) {
 		start_auto_move();
 
 	if (check_flag(QD_OBJ_MOVING_FLAG)) {
-		if (g_engine->_gameVersion <= 20030919 || future_pos_correct(dt)) {
+		if (g_engine->_gameVersion <= 20041201 || future_pos_correct(dt)) {
 			bool end_movement = false;
 			Vect3f r = get_future_r(dt, end_movement, true);
 
@@ -895,7 +895,7 @@ void qdGameObjectMoving::quant(float dt) {
 					if (_target_angle >= 0.0f)
 						_direction_angle = _target_angle;
 
-					if (g_engine->_gameVersion <= 20030919) {
+					if (g_engine->_gameVersion <= 20060129) {
 						drop_flag(QD_OBJ_MOVING_FLAG);
 						set_direction(_direction_angle);
 
@@ -1082,7 +1082,7 @@ bool qdGameObjectMoving::update_screen_pos() {
 				case MOVEMENT_MODE_END:
 					offs_type = qdGameObjectStateWalk::OFFSET_END;
 					break;
-				case MOVEMENT_MODE_NONE_EARLY: // _gameVersion <= 20030919
+				case MOVEMENT_MODE_NONE_EARLY: // _gameVersion <= 20060129
 					if (!check_flag(QD_OBJ_MOVING_FLAG))
 						offs_type = qdGameObjectStateWalk::OFFSET_STATIC;
 				}
@@ -2042,7 +2042,7 @@ bool qdGameObjectMoving::set_walk_animation() {
 				}
 			}
 			break;
-		case MOVEMENT_MODE_NONE_EARLY: // _gameVersion <= 20030919
+		case MOVEMENT_MODE_NONE_EARLY: // _gameVersion <= 20060129
 		default:
 			break;
 		}
@@ -2089,7 +2089,7 @@ bool qdGameObjectMoving::movement_impulse() {
 	_impulse_direction = -1.0f;
 	_target_angle = -1.0f;
 
-	if (g_engine->_gameVersion <= 20030919)
+	if (g_engine->_gameVersion <= 20060129)
 		set_walk_animation();
 
 	if (_movement_mode == MOVEMENT_MODE_STOP || _movement_mode == MOVEMENT_MODE_END)


Commit: d8478e5512c7e8129b67786c193d74320416ca74
    https://github.com/scummvm/scummvm/commit/d8478e5512c7e8129b67786c193d74320416ca74
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Fix inventory being drawn in main menu

Works for the game versions up (including) to 20060715

Changed paths:
    engines/qdengine/qdcore/qd_game_dispatcher.cpp


diff --git a/engines/qdengine/qdcore/qd_game_dispatcher.cpp b/engines/qdengine/qdcore/qd_game_dispatcher.cpp
index 3551cf76550..9bb997367b7 100644
--- a/engines/qdengine/qdcore/qd_game_dispatcher.cpp
+++ b/engines/qdengine/qdcore/qd_game_dispatcher.cpp
@@ -2395,7 +2395,7 @@ bool qdGameDispatcher::keyboard_handler(Common::KeyCode vkey, bool event) {
 	}
 
 	if (event) {
-		if (_interface_dispatcher.keyboard_handler(vkey))
+		if (g_engine->_gameVersion > 20060715 && _interface_dispatcher.keyboard_handler(vkey))
 			return true;
 
 		switch (vkey) {


Commit: 50e87bd252c9689fdfeb59f1fba6950a6a4a69ce
    https://github.com/scummvm/scummvm/commit/50e87bd252c9689fdfeb59f1fba6950a6a4a69ce
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-15T15:34:01+08:00

Commit Message:
QDENGINE: Fix zigzag pattern in character's path for older games

Changed paths:
    engines/qdengine/qdcore/qd_game_object_moving.cpp


diff --git a/engines/qdengine/qdcore/qd_game_object_moving.cpp b/engines/qdengine/qdcore/qd_game_object_moving.cpp
index 9a3b25daea5..92a66645ec3 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_moving.cpp
@@ -493,7 +493,7 @@ bool qdGameObjectMoving::find_path(const Vect3f target, bool lock_target) {
 	debugC(3, kDebugLog, "Optimised Path");
 	dump_vect(path_vect);
 
-	if (path_vect.size() >= 2 && (movement_type() == qdGameObjectStateWalk::MOVEMENT_FOUR_DIRS || movement_type() == qdGameObjectStateWalk::MOVEMENT_EIGHT_DIRS)) {
+	if (g_engine->_gameVersion > 20041201 && path_vect.size() >= 2 && (movement_type() == qdGameObjectStateWalk::MOVEMENT_FOUR_DIRS || movement_type() == qdGameObjectStateWalk::MOVEMENT_EIGHT_DIRS)) {
 		Std::vector<Vect3f> final_path;
 		finalize_path(R(), trg, path_vect, final_path);
 
@@ -510,10 +510,13 @@ bool qdGameObjectMoving::find_path(const Vect3f target, bool lock_target) {
 			_path[idx] = qdCamera::current_camera()->get_cell_coords(it->x, it->y);
 			idx ++;
 		}
-		_path[idx - 1] = trg;
+		if (g_engine->_gameVersion <= 20041201)
+			_path[idx] = trg;
+		else
+			_path[idx - 1] = trg;
 	}
 
-	_cur_path_index = (idx > 1) ? 1 : 0;
+	_cur_path_index = (g_engine->_gameVersion <= 20041201 || idx > 1) ? 1 : 0;
 	_path_length = idx;
 	move2position(_path[_cur_path_index++]);
 




More information about the Scummvm-git-logs mailing list