Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pill bottle emptying bugfix #7357

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Pill bottle emptying bugfix #7357

merged 2 commits into from
Nov 20, 2024

Conversation

SpypigDev
Copy link
Contributor

@SpypigDev SpypigDev commented Oct 22, 2024

About the pull request

Fixes an annoying bug introduced in #7265 which caused pill bottles to run through two simultaneous emptying processes whenever used in the hand. First trying to empty their contents, then moving to their own pill drawing code, and trying to draw a single pill from the empty bottle.

This PR bypasses the typical emptying system, for pill bottles and packets, allowing a single pill to be drawn from a pill bottle in hand with Z, but still leaves the empty verb functional, so bottles can be emptied by selecting the option after right clicking.

Explain why it's good for the game

While I recognize I am in the vast minority, some HM players still prefer not to use the belt system of drawing directly from pill bottles when treating patients.

Drawing a pill from a pill bottle held in the hand allows HMs to keep track of which medications have been given, and in what order.

#7265 broke this system by forcing HMs to start emptying pill bottles in the hand on a click, rather than drawing a single pill, making it exceptionally annoying to medicate wounded without belt mode, and near impossible to do so without a belt.

This PR allows both systems to co-exist, letting HMs draw a single pill from bottles held in the hand if they choose to do so, and still leaving the empty verb on pill bottles, so that their contents can be dumped through the right click menu

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
fix: no longer forces pill bottles to begin emptying on a click
/:cl:

@cmss13-ci cmss13-ci bot added the Fix Fix one bug, make ten more label Oct 22, 2024
Copy link
Contributor

@Drulikar Drulikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better as a flag that you can just have pill bottles in their definition say they don't allow rather than having every single item check if its a pill bottle.

E.g.

in storage.dm

	if(length(contents))
		if(!(storage_flags & STORAGE_DISABLE_USE_EMPTY))
			empty(user)
		return

in equipment.dm

/// Whether using this item will try not to empty it if possible
#define STORAGE_DISABLE_USE_EMPTY (1<<12)

Please also move all the // comments on those storage flags to be above them as autodoc comments ///

and in bitfields.dm:

	"STORAGE_DISABLE_USE_EMPTY" = STORAGE_DISABLE_USE_EMPTY,

and in firstaid.dm for /obj/item/storage/pill_bottle:

	storage_flags = STORAGE_FLAGS_BOX|STORAGE_CLICK_GATHER|STORAGE_QUICK_GATHER|STORAGE_DISABLE_USE_EMPTY

@Drulikar Drulikar marked this pull request as draft November 19, 2024 21:26
@SpypigDev SpypigDev marked this pull request as ready for review November 20, 2024 10:04
@SpypigDev SpypigDev requested a review from Drulikar November 20, 2024 10:06
@Drulikar Drulikar added this pull request to the merge queue Nov 20, 2024
Merged via the queue into cmss13-devs:master with commit 1310a84 Nov 20, 2024
28 checks passed
cmss13-ci bot added a commit that referenced this pull request Nov 20, 2024
@SpypigDev SpypigDev deleted the pillbox branch November 20, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Fix one bug, make ten more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants