mad dog no longer perma deletes items on failed disarm#1119
mad dog no longer perma deletes items on failed disarm#1119NewyearnewmeUwu wants to merge 2 commits into
Conversation
00-Steven
left a comment
There was a problem hiding this comment.
apparently i did not actually send this review when i looked at it
|
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 |
00-Steven
left a comment
There was a problem hiding this comment.
hi chief i did it again i did it Again by gods help me and the submit review button
| if(disarmed_item && prob(20)) | ||
| if(defender.temporarilyRemoveItemFromInventory(disarmed_item)) | ||
| attacker.put_in_hands(disarmed_item) | ||
| else | ||
| disarmed_item = null |
There was a problem hiding this comment.
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 = nullor
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_disarmor 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
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: