[Scummvm-git-logs] scummvm master -> 2e5642c847d67fe7e898bd935134046387032d3f

bluegr noreply at scummvm.org
Sat Sep 19 18:43:45 UTC 2026


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

Summary:
4ed9248276 NANCY: Keep the held item when AddInventoryNoHS picks it again
2e5642c847 NANCY: Fix stale item highlight in the inventory box


Commit: 4ed9248276d22dcd780865b7edc9c3608f70330b
    https://github.com/scummvm/scummvm/commit/4ed9248276d22dcd780865b7edc9c3608f70330b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-09-19T21:42:35+03:00

Commit Message:
NANCY: Keep the held item when AddInventoryNoHS picks it again

When AddInventoryNoHS puts an item in the cursor and the player is
already holding that item, treat the record as done. Previously the
item counted as another held item, so it was put back in the
inventory. This happened whenever a scene changed back to itself,
which runs its records again.

Fixes Nancy putting the pen away when clicking a task in the task list
in Nancy6 (scene 2850).

Fix #16871

Changed paths:
    engines/nancy/action/inventoryrecords.cpp


diff --git a/engines/nancy/action/inventoryrecords.cpp b/engines/nancy/action/inventoryrecords.cpp
index bc26adc8146..308cb7835dd 100644
--- a/engines/nancy/action/inventoryrecords.cpp
+++ b/engines/nancy/action/inventoryrecords.cpp
@@ -42,7 +42,9 @@ void AddInventoryNoHS::readData(Common::SeekableReadStream &stream) {
 
 void AddInventoryNoHS::execute() {
 	if (_setCursor) {
-		if (NancySceneState.getHeldItem() != -1) {
+		if (NancySceneState.getHeldItem() == _itemID) {
+			// Already holding the item, e.g. when the scene reloads itself
+		} else if (NancySceneState.getHeldItem() != -1) {
 			// Currently holding another item
 			if (_forceCursor) {
 				NancySceneState.addItemToInventory(NancySceneState.getHeldItem());


Commit: 2e5642c847d67fe7e898bd935134046387032d3f
    https://github.com/scummvm/scummvm/commit/2e5642c847d67fe7e898bd935134046387032d3f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-09-19T21:43:14+03:00

Commit Message:
NANCY: Fix stale item highlight in the inventory box

The highlighted item slot was only reset when an item was clicked. When
items were added or removed by action records, or the box scrolled to
another page, the slot kept pointing at a different item. The highlight
could then stay on screen, or the hovered item wasn't highlighted.
Reset the highlight whenever the inventory is reordered, and remove it
before the page changes.

Changed paths:
    engines/nancy/ui/inventorybox.cpp


diff --git a/engines/nancy/ui/inventorybox.cpp b/engines/nancy/ui/inventorybox.cpp
index da709be0d45..7bf367fddf5 100644
--- a/engines/nancy/ui/inventorybox.cpp
+++ b/engines/nancy/ui/inventorybox.cpp
@@ -135,7 +135,6 @@ void InventoryBox::handleInput(NancyInput &input) {
 					if (!disabled) {
 						// Item is not disabled
 						NancySceneState.removeItemFromInventory(itemID, item.keepItem != kInvItemNewSceneView);
-						_highlightedHotspot = -1;
 						hoveredHotspot = -1;
 
 						if (item.keepItem == kInvItemNewSceneView) {
@@ -198,6 +197,8 @@ void InventoryBox::removeItem(const int16 itemID) {
 }
 
 void InventoryBox::onReorder() {
+	// Every slot gets redrawn without highlighting below
+	_highlightedHotspot = -1;
 	onScrollbarMove();
 
 	_fullInventorySurface.clear();
@@ -250,6 +251,12 @@ void InventoryBox::onScrollbarMove() {
 	sourceRect.moveTo(0, curPage * (sourceRect.height() - 1));
 	_drawSurface.create(_fullInventorySurface, sourceRect);
 
+	// The hotspots are about to point at different items
+	if (_highlightedHotspot != -1) {
+		drawItemInSlot(_itemHotspots[_highlightedHotspot].itemID, _itemHotspots[_highlightedHotspot].itemOrder, false);
+		_highlightedHotspot = -1;
+	}
+
 	setHotspots(curPage);
 
 	_needsRedraw = true;




More information about the Scummvm-git-logs mailing list