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

Fixes runtime on death by decapitation #5328

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

Birdtalon
Copy link
Contributor

@Birdtalon Birdtalon commented Dec 28, 2023

About the pull request

Fixes two runtimes caused by passing an invalid argument type to death() it should be /datum/cause_data and we passed a /mob.

Player decapitated themselves by shooting themselves in the head.

The extra typechecks are there because I don't want to assume that cause is always going to be a mob. If it's not a mob or cause_data already then we create a cause data with mob = null so at least we're passing it correctly to death()

[2023-12-28 17:54:11.462] runtime error: death called with string cause (Unknown (as Sherri Baker)) instead of datum
 - proc name: stack trace (/proc/stack_trace)
 -   source file: code/__HELPERS/unsorted.dm,1888
 -   usr: Unknown (as Sherri Baker) (/mob/living/carbon/human)
 -   src: null
 -   usr.loc: the floor (288,32,4) (/turf/open/floor/almayer)
 -   call stack:
 - stack trace("death called with string cause...")
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): death(Unknown (as Sherri Baker) (/mob/living/carbon/human), 0, "seizes up and falls limp, thei...")
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): death(Unknown (as Sherri Baker) (/mob/living/carbon/human), null)
 - the head (/obj/limb/head): droplimb(0, 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), null)
 - the head (/obj/limb/head): limb delimb(Unknown (as Sherri Baker) (/mob/living/carbon/human))
 - the head (/obj/limb/head): take damage(44, 0, 0, 0, null, /list (/list), 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), -1, 0, 0)
 - the head (/obj/limb/head): take damage(44, 0, 0, 0, null, /list (/list), 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), -1, -1)
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): apply damage(44, "brute", "head", 0, 0, null, 0, 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), 0)
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): bullet act(the rifle bullet (/obj/projectile))
 - the M41A pulse rifle MK2 (Wiel... (/obj/item/weapon/gun/rifle/m41a): attack(Unknown (as Sherri Baker) (/mob/living/carbon/human), Unknown (as Sherri Baker) (/mob/living/carbon/human), null)
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): attackby(the M41A pulse rifle MK2 (Wiel... (/obj/item/weapon/gun/rifle/m41a), Unknown (as Sherri Baker) (/mob/living/carbon/human), /list (/list))
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): attackby(the M41A pulse rifle MK2 (Wiel... (/obj/item/weapon/gun/rifle/m41a), Unknown (as Sherri Baker) (/mob/living/carbon/human), /list (/list))
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): click adjacent(Unknown (as Sherri Baker) (/mob/living/carbon/human), the M41A pulse rifle MK2 (Wiel... (/obj/item/weapon/gun/rifle/m41a), /list (/list))
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): do click(Unknown (as Sherri Baker) (/mob/living/carbon/human), the floor (288,32,4) (/turf/open/floor/almayer), "icon-x=17;icon-y=19;left=1;but...")
 - **** (/client): Click(Unknown (as Sherri Baker) (/mob/living/carbon/human), the floor (288,32,4) (/turf/open/floor/almayer), "mapwindow.map", "icon-x=17;icon-y=19;left=1;but...")
 - 
[2023-12-28 17:54:11.465] runtime error: undefined variable /mob/living/carbon/human/var/cause_name
 - proc name: death (/mob/living/carbon/human/death)
 -   source file: code/modules/mob/living/carbon/human/death.dm,117
 -   usr: (src)
 -   src: Unknown (as Sherri Baker) (/mob/living/carbon/human)
 -   src.loc: the floor (288,32,4) (/turf/open/floor/almayer)
 -   call stack:
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): death(Unknown (as Sherri Baker) (/mob/living/carbon/human), null)
 - the head (/obj/limb/head): droplimb(0, 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), null)
 - the head (/obj/limb/head): limb delimb(Unknown (as Sherri Baker) (/mob/living/carbon/human))
 - the head (/obj/limb/head): take damage(44, 0, 0, 0, null, /list (/list), 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), -1, 0, 0)
 - the head (/obj/limb/head): take damage(44, 0, 0, 0, null, /list (/list), 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), -1, -1)
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): apply damage(44, "brute", "head", 0, 0, null, 0, 0, Unknown (as Sherri Baker) (/mob/living/carbon/human), 0)
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): bullet act(the rifle bullet (/obj/projectile))
 - the M41A pulse rifle MK2 (/obj/item/weapon/gun/rifle/m41a): attack(Unknown (as Sherri Baker) (/mob/living/carbon/human), Unknown (as Sherri Baker) (/mob/living/carbon/human), null)
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): attackby(the M41A pulse rifle MK2 (/obj/item/weapon/gun/rifle/m41a), Unknown (as Sherri Baker) (/mob/living/carbon/human), /list (/list))
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): attackby(the M41A pulse rifle MK2 (/obj/item/weapon/gun/rifle/m41a), Unknown (as Sherri Baker) (/mob/living/carbon/human), /list (/list))
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): click adjacent(Unknown (as Sherri Baker) (/mob/living/carbon/human), the M41A pulse rifle MK2 (/obj/item/weapon/gun/rifle/m41a), /list (/list))
 - Unknown (as Sherri Baker) (/mob/living/carbon/human): do click(Unknown (as Sherri Baker) (/mob/living/carbon/human), the floor (288,32,4) (/turf/open/floor/almayer), "icon-x=17;icon-y=19;left=1;but...")
 - **** (/client): Click(Unknown (as Sherri Baker) (/mob/living/carbon/human), the floor (288,32,4) (/turf/open/floor/almayer), "mapwindow.map", "icon-x=17;icon-y=19;left=1;but...")
 - 

Explain why it's good for the game

Testing Photographs and Procedure

Screenshots & Videos

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

Changelog

🆑
fix: Fixes a runtime on decapping one's self.
/:cl:

@github-actions github-actions bot added the Fix Fix one bug, make ten more label Dec 28, 2023
Copy link
Member

@fira fira left a comment

Choose a reason for hiding this comment

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

well i'd argue we should rather fix it at root but if it works...

@Drulikar Drulikar added this pull request to the merge queue Dec 30, 2023
Merged via the queue into cmss13-devs:master with commit 2e8e334 Dec 30, 2023
28 checks passed
cm13-github added a commit that referenced this pull request Dec 30, 2023
@Birdtalon Birdtalon deleted the delimbcause branch February 25, 2024 12:52
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.

4 participants