[Scummvm-git-logs] scummvm master -> f1f6282da2efb9a266a028efce10aa4b746508b6

bluegr noreply at scummvm.org
Sat Jul 11 04:45:52 UTC 2026


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

Summary:
f1f6282da2 CHEWY: Fix losing inventory item from stand by window, bug #16622


Commit: f1f6282da2efb9a266a028efce10aa4b746508b6
    https://github.com/scummvm/scummvm/commit/f1f6282da2efb9a266a028efce10aa4b746508b6
Author: Max H. Gerlach (git at maxgerlach.de)
Date: 2026-07-11T07:45:48+03:00

Commit Message:
CHEWY: Fix losing inventory item from stand by window, bug #16622

When clicking an item in the "stand-by window" or by turning the mouse
wheel while an item is present in the stand-by window, the item would
vanish from the game. With this change the item is returned to the
main inventory instead.

Assisted-by: Claude:claude-fable-5

Changed paths:
    engines/chewy/events.cpp
    engines/chewy/main.cpp


diff --git a/engines/chewy/events.cpp b/engines/chewy/events.cpp
index c2115271b29..08dcd9af508 100644
--- a/engines/chewy/events.cpp
+++ b/engines/chewy/events.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/system.h"
+#include "chewy/cursor.h"
 #include "chewy/events.h"
 #include "chewy/globals.h"
 
@@ -75,6 +76,13 @@ void EventsManager::handleEvent(const Common::Event &event) {
 		handleKbdEvent(event);
 }
 
+static void returnInventoryCursorToSlot() {
+	if (_G(cur)->usingInventoryCursor()) {
+		invent_2_slot(_G(cur)->getInventoryCursor());
+		_G(cur)->setInventoryCursor(-1);
+	}
+}
+
 void EventsManager::handleMouseEvent(const Common::Event &event) {
 	_pendingEvents.push(event);
 
@@ -99,6 +107,7 @@ void EventsManager::handleMouseEvent(const Common::Event &event) {
 	case Common::EVENT_WHEELUP:
 		// Cycle backwards through cursors
 		if (isWheelEnabled) {
+			returnInventoryCursorToSlot();
 			if (--_G(menu_item) < 0)
 				_G(menu_item) = CUR_TALK;
 			cursorChoice(_G(menu_item));
@@ -108,6 +117,7 @@ void EventsManager::handleMouseEvent(const Common::Event &event) {
 	case Common::EVENT_WHEELDOWN:
 		// Cycle forwards through cursors
 		if (isWheelEnabled) {
+			returnInventoryCursorToSlot();
 			if (++_G(menu_item) > CUR_TALK)
 				_G(menu_item) = CUR_WALK;
 			cursorChoice(_G(menu_item));
@@ -117,6 +127,7 @@ void EventsManager::handleMouseEvent(const Common::Event &event) {
 	case Common::EVENT_MBUTTONDOWN:
 		// Toggle between walk and look cursor
 		if (isWheelEnabled) {
+			returnInventoryCursorToSlot();
 			_G(menu_item) = (_G(menu_item) == CUR_WALK) ? CUR_LOOK : CUR_WALK;
 			cursorChoice(_G(menu_item));
 		}
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index f9d40ba0867..9c518ea18b5 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -807,6 +807,7 @@ void mouseAction() {
 				else if (_G(cur)->usingInventoryCursor()) {
 					if (_G(inv_disp_ok)) {
 						if (_G(cur)->usingInventoryCursor()) {
+							invent_2_slot(_G(cur)->getInventoryCursor());
 							_G(menu_item) = CUR_USE;
 							cursorChoice(_G(menu_item));
 							_G(cur)->setInventoryCursor(-1);




More information about the Scummvm-git-logs mailing list