Skip to content

Commit

Permalink
DS doorgun no longer drops the gun when destroyed (#5211)
Browse files Browse the repository at this point in the history
# About the pull request

this bug has been around for a looong time, someone might be tempted to
abuse it with the MG changes

# Explain why it's good for the game

moveable m56d with 1500 rounds that can shoot over cover is not intended


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

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

</details>


# Changelog

:cl:
fix: DS doorgun no longer drops the gun when destroyed
/:cl:

---------

Co-authored-by: vincibrv <[email protected]>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2023
1 parent d194aa6 commit 61e8a48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/modules/cm_marines/dropship_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@
deployed_mg = new(src)
deployed_mg.deployment_system = src

/obj/structure/dropship_equipment/mg_holder/Destroy()
QDEL_NULL(deployed_mg)
. = ..()

/obj/structure/dropship_equipment/mg_holder/get_examine_text(mob/user)
. = ..()
if(!deployed_mg)
Expand Down Expand Up @@ -360,7 +364,7 @@
deployed_mg.forceMove(src)
deployed_mg.setDir(dir)
else
icon_state = "mg_system_destroyed"
icon_state = "sentry_system_destroyed"

/obj/structure/dropship_equipment/mg_holder/proc/deploy_mg(mob/user)
if(deployed_mg)
Expand Down
12 changes: 12 additions & 0 deletions code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,18 @@
zoom = 1
ammo = /datum/ammo/bullet/machinegun/doorgun

/obj/structure/machinery/m56d_hmg/mg_turret/update_health(amount) //Negative values restores health.
health -= amount
if(health <= 0)
playsound(src.loc, 'sound/items/Welder2.ogg', 25, 1)
qdel(src)
return

if(health > health_max)
health = health_max
update_damage_state()
update_icon()

/obj/structure/machinery/m56d_hmg/mg_turret/dropship
name = "\improper scoped M56D heavy machine gun"
desc = "A scoped M56D heavy machine gun mounted behind a metal shield. Drag its sprite onto yourself to man it. Ctrl-click it to toggle burst fire."
Expand Down

0 comments on commit 61e8a48

Please sign in to comment.