Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PRIVATE: Fix drug bag inventory item - #7031

Merged
neuromancer merged 1 commit into
scummvm:masterfrom
sluicebox:private-finventory
Nov 15, 2025
Merged

PRIVATE: Fix drug bag inventory item#7031
neuromancer merged 1 commit into
scummvm:masterfrom
sluicebox:private-finventory

Conversation

@sluicebox

@sluicebox sluicebox commented Nov 15, 2025

Copy link
Copy Markdown
Member

If an item is already in inventory, then calling Inventory() with a mask should do nothing. This fixes the drug bag in the doctor's office. It has been reappearing in ScummVM even after the player takes it.

This may be the only affected inventory item. Usually, the game scripts test an item's flag before calling Inventory() or loading the mask that leads to Inventory().

Note that there is another unrelated problem with this inventory item; Marlowe's "I took it" sound effect doesn't play in ScummVM. It is immediately interrupted by a SoundEffect() call in the next setting.

setting kDLHollowBook
{
	...
	if (kState16OrrinDead)
	{
		Bitmap("dl\search_s\dlbkocu4.bmp");
		Inventory("dl\search_s\dlbkmk9.bmp", kInventoryMarijuanaBag, kPickedUpMarijuanaBag, kDLBookcase, "inface\diary\invlist\dryinv16.bmp", "", 1, 2, "");
	}
	...
}

setting kDLBookcase
{
	if (kDrawerOpen)
	{
		SetFlag(kDrawerOpen, FALSE);
		SoundEffect("dl\audio\dlsfx002.wav");	// Slider closing
	}
	...
}
bag

If an item is already in inventory, then calling Inventory() with a mask
should do nothing. This fixes the drug bag in the doctor's office.
It has been reappearing even after the player takes it.

This may be the only inventory item affected by this behavior. Usually,
the game scripts test the item's flag before calling Inventory() or
loading the mask that leads to the Inventory() call.
@neuromancer
neuromancer merged commit b4d6ae9 into scummvm:master Nov 15, 2025
1 check passed
@neuromancer

Copy link
Copy Markdown
Contributor

Good catch!

@sluicebox
sluicebox deleted the private-finventory branch November 15, 2025 15:02
@neuromancer

Copy link
Copy Markdown
Contributor

FYI, this PR introduced a bug in the demo. All the calls to inventory from the demo use the "" as bmp (there is no way to check the inventory nor any need to keep track of it). So, once you picked one object, all the others will fail to run. It was fixed in 024fe7c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants