Skip to content

mad dog no longer perma deletes items on failed disarm#1119

Open
NewyearnewmeUwu wants to merge 2 commits into
DopplerShift13:masterfrom
NewyearnewmeUwu:maddogonaleash
Open

mad dog no longer perma deletes items on failed disarm#1119
NewyearnewmeUwu wants to merge 2 commits into
DopplerShift13:masterfrom
NewyearnewmeUwu:maddogonaleash

Conversation

@NewyearnewmeUwu

Copy link
Copy Markdown

About The Pull Request

there was the temp_remove_from_inventory proc being called int he same If statement as the prob(20) meaning there's an 80% chance for mad dog to just delete an item forever. sent to super hell!! fixes #1078

Why It's Good For The Game

it ain't

Testing Evidence

Works!

Changelog

🆑
fix: Mad Dog disarm no longer deletes items
/:cl:

@dawsonkeyes dawsonkeyes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

@00-Steven 00-Steven left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

apparently i did not actually send this review when i looked at it

Comment thread modular_doppler/martial_arts/mad_dog.dm Outdated
@github-actions github-actions Bot requested a review from 00-Steven June 29, 2026 18:58
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions Bot added the Stale label Jul 7, 2026

@00-Steven 00-Steven left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hi chief i did it again i did it Again by gods help me and the submit review button

Comment on lines +240 to 244
if(disarmed_item && prob(20))
if(defender.temporarilyRemoveItemFromInventory(disarmed_item))
attacker.put_in_hands(disarmed_item)
else
disarmed_item = null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

still doesn't set disarmed_item = null on failure, as per previous review
the code following this needs disarmed_item to be set to null if it hasn't successfully disarmed, whether because such item didn't exist, because the chance failed, or it couldn't remove it
otherwise it'll say it struck out an item that it didn't in the following code

so honestly better ideas:

if(item_to_disarm)
	if(prob(20) && defender.temporarilyRemoveItemFromInventory(disarmed_item ))
		attacker.put_in_hands(disarmed_item)
	else
		disarmed_item = null

or

var/obj/item/disarmed_item = null
var/obj/item/item_to_disarm = defender.get_active_held_item()
if(item_to_disarm && prob(20))
	if(defender.temporarilyRemoveItemFromInventory(item_to_disarm))
		attacker.put_in_hands(item_to_disarm)
		disarmed_item = item_to_disarm

or like

var/obj/item/disarmed_item = attempt_disarm_item(attacker, defender)

with attempt_disarm_item(...) being

/// Attempts to disarm the defender's held item, returning it if successful, or null if unsuccessful.
/datum/martial_art/mad_dog/proc/attempt_disarm_item(mob/living/attacker, mob/living/defender)
	var/obj/item/disarmed_item = defender.get_active_held_item()
	if(isnull(disarmed_item))
		return null
	if(prob(80))
		return null
	if(!defender.temporarilyRemoveItemFromInventory(item_to_disarm))
		return null
	return disarmed_item

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

Labels

Fix Pest removal; Bugs Removal Goodbye Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mad Dog Style currently QDeletes weapons on disarm instead of actually disarming

3 participants