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

Null reference fix for full auto #4340

Merged

Conversation

morrowwolf
Copy link
Member

@morrowwolf morrowwolf commented Sep 5, 2023

About the pull request

If you drop the gun while holding down full auto it will attempt to fire the next shot. The (!user) check on line 1917 just tries to assign gun_user to user but since there is no gun_user either it passes null. I debated on where to put this check for if user existed and am happy to move it around (and also remove the !target as it doesn't seem to have any issues so far).

runtime error: Cannot execute null.is mob incapacitated().
proc name: able to fire (/obj/item/weapon/gun/proc/able_to_fire)
  source file: code/modules/projectiles/gun.dm,1495
  usr: null
  src: the NSG 23 assault rifle (/obj/item/weapon/gun/rifle/nsg23/no_lock)
  src.loc: the floor (36,18,2) (/turf/open/floor/greengrid)
  call stack:
the NSG 23 assault rifle (/obj/item/weapon/gun/rifle/nsg23/no_lock): able to fire(null)
the NSG 23 assault rifle (/obj/item/weapon/gun/rifle/nsg23/no_lock): Fire(the grass (36,25,2) (/turf/open/gm/grass/grass1), null, null, 0, null)
the NSG 23 assault rifle (/obj/item/weapon/gun/rifle/nsg23/no_lock): fire wrapper(the grass (36,25,2) (/turf/open/gm/grass/grass1), null, null, 0, null)
/datum/callback (/datum/callback): Invoke()
/datum/component/automatedfire... (/datum/component/automatedfire/autofire): process shot()
ImmediateInvokeAsync(/datum/component/automatedfire... (/datum/component/automatedfire/autofire), "process_shot")
Automated fire (/datum/controller/subsystem/automatedfire): fire(0)
Automated fire (/datum/controller/subsystem/automatedfire): ignite(0)
Master (/datum/controller/master): RunQueue()
Master (/datum/controller/master): Loop(2)
Master (/datum/controller/master): StartProcessing(0)

Changelog

🆑 Morrow
fix: Fixed a null reference when firing full auto and dropping your weapon
/:cl:

@github-actions github-actions bot added the Fix Fix one bug, make ten more label Sep 5, 2023
Copy link
Contributor

@Zonespace27 Zonespace27 left a comment

Choose a reason for hiding this comment

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

Looks like it shouldn't shit the bed anywhere

@Zonespace27 Zonespace27 added this pull request to the merge queue Sep 6, 2023
Merged via the queue into cmss13-devs:master with commit c79e35c Sep 6, 2023
27 checks passed
cm13-github added a commit that referenced this pull request Sep 6, 2023
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