Skip to content

Commit

Permalink
Fixes being able to load a flamer tank with no flamer unit (#4825)
Browse files Browse the repository at this point in the history
# About the pull request
Closes #4824
Makes it so that you have to have the Broiler equipped in your back
before you are allowed to switch out fuel tanks.
If you used the verb after unequipping the broiler from your back and
then dropped it, it was possible to remove the tank from the flamer by
clicking it.
This caused issues because the tank would then teleport to you from
anywhere after switching fuel types again.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Bugfix
# Changelog
:cl:
fix: Fixes being able to create ghost tanks from a Broiler-T unit.
/:cl:

---------

Co-authored-by: Drathek <[email protected]>
  • Loading branch information
Xander3359 and Drulikar authored Nov 6, 2023
1 parent 0a64aac commit 7ea7e72
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions code/game/objects/items/storage/large_holster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,13 @@
if(!ishuman(user) || user.is_mob_incapacitated())
return FALSE

var/obj/item/weapon/gun/flamer/M240T/F = user.get_active_hand()
if(!istype(F))
to_chat(usr, "You must be holding the M240-T incinerator unit to use [src]")
if(user.back != src)
to_chat(user, "The [src] must be equipped before you can switch types")
return

var/obj/item/weapon/gun/flamer/M240T/flamer = user.get_active_hand()
if(!istype(flamer))
to_chat(user, "You must be holding the M240-T incinerator unit to use [src]")
return

if(!active_fuel)
Expand All @@ -267,14 +271,13 @@
else
active_fuel = fuelB

for(var/X in actions)
var/datum/action/A = X
A.update_button_icon()
for(var/datum/action/action_added as anything in actions)
action_added.update_button_icon()

to_chat(user, "You switch the fuel tank to <b>[active_fuel.caliber]</b>")
playsound(src, 'sound/machines/click.ogg', 25, TRUE)
F.current_mag = active_fuel
F.update_icon()
flamer.current_mag = active_fuel
flamer.update_icon()

return TRUE

Expand Down

0 comments on commit 7ea7e72

Please sign in to comment.