diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm
index 39222a1e0ea..2fa876a5891 100644
--- a/code/game/objects/items/weapons/tanks/jetpack.dm
+++ b/code/game/objects/items/weapons/tanks/jetpack.dm
@@ -13,8 +13,9 @@
/obj/item/weapon/tank/jetpack/New()
..()
- air_contents.assert_gas(gas_type)
- air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
+ if(gas_type)
+ air_contents.assert_gas(gas_type)
+ air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
ion_trail = new
ion_trail.set_up(src)
@@ -110,20 +111,34 @@
distribute_pressure = 0
gas_type = "co2"
+
/obj/item/weapon/tank/jetpack/suit
- name = "suit inbuilt jetpack"
- desc = "A device that will use your internals tank as a gas source for propulsion."
- icon_state = "jetpack-void"
- item_state = "jetpack-void"
+ name = "hardsuit jetpack upgrade"
+ desc = "A modular, compact set of thrusters designed to integrate with a hardsuit. It is fueled by a tank inserted into the suit's storage compartment."
+ origin_tech = "materials=4;magnets=4;engineering=5"
+ icon_state = "jetpack-upgrade"
+ item_state = "jetpack-black"
+ w_class = 3
actions_types = list(/datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
+ volume = 1
+ slot_flags = null
+ gas_type = null
+ var/datum/gas_mixture/temp_air_contents
var/obj/item/weapon/tank/internals/tank = null
/obj/item/weapon/tank/jetpack/suit/New()
..()
STOP_PROCESSING(SSobj, src)
- air_contents = null
+ temp_air_contents = air_contents
+
+/obj/item/weapon/tank/jetpack/suit/attack_self()
+ return
/obj/item/weapon/tank/jetpack/suit/cycle(mob/user)
+ if(!istype(loc, /obj/item/clothing/suit/space/hardsuit))
+ user << "\The [src] must be connected to a hardsuit!"
+ return
+
var/mob/living/carbon/human/H = user
if(!istype(H.s_store, /obj/item/weapon/tank/internals))
user << "You need a tank in your suit storage!"
@@ -131,7 +146,7 @@
..()
/obj/item/weapon/tank/jetpack/suit/turn_on()
- if(!ishuman(loc.loc))
+ if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
return
var/mob/living/carbon/human/H = loc.loc
tank = H.s_store
@@ -141,12 +156,12 @@
/obj/item/weapon/tank/jetpack/suit/turn_off()
tank = null
- air_contents = null
+ air_contents = temp_air_contents
STOP_PROCESSING(SSobj, src)
..()
/obj/item/weapon/tank/jetpack/suit/process()
- if(!ishuman(loc.loc))
+ if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
turn_off()
return
var/mob/living/carbon/human/H = loc.loc
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
index d2a495459ef..cdc875701cb 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
@@ -11,7 +11,7 @@
new /obj/item/clothing/head/welding(src)
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
- new /obj/item/hardsuit_jetpack(src)
+ new /obj/item/weapon/tank/jetpack/suit(src)
new /obj/item/weapon/cartridge/ce(src)
new /obj/item/device/radio/headset/heads/ce(src)
new /obj/item/weapon/storage/toolbox/mechanical(src)
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index f3c478ce9e7..c439f511d1d 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -88,6 +88,34 @@
jetpack = new jetpack(src)
..()
+/obj/item/clothing/suit/space/hardsuit/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/weapon/tank/jetpack/suit))
+ if(jetpack)
+ user << "[src] already has a jetpack installed."
+ return
+ if(src == user.get_item_by_slot(slot_wear_suit)) //Make sure the player is not wearing the suit before applying the upgrade.
+ user << "You cannot install the upgrade to [src] while wearing it."
+ return
+
+ if(user.unEquip(I))
+ jetpack = I
+ I.loc = src
+ user << "You successfully install the jetpack into [src]."
+
+ else if(istype(I, /obj/item/weapon/screwdriver))
+ if(!jetpack)
+ user << "[src] has no jetpack installed."
+ return
+ if(src == user.get_item_by_slot(slot_wear_suit))
+ user << "You cannot remove the jetpack from [src] while wearing it."
+ return
+
+ jetpack.turn_off()
+ jetpack.loc = get_turf(src)
+ jetpack = null
+ user << "You successfully remove the jetpack from [src]."
+
+
/obj/item/clothing/suit/space/hardsuit/equipped(mob/user, slot)
..()
if(jetpack)
diff --git a/code/modules/mining/equipment.dm b/code/modules/mining/equipment.dm
index fdb6380e264..85924dd4a0f 100644
--- a/code/modules/mining/equipment.dm
+++ b/code/modules/mining/equipment.dm
@@ -441,28 +441,6 @@
icon = 'icons/obj/mining.dmi'
icon_state = "xeno_warning"
-/******************Hardsuit Jetpack Upgrade*******************/
-/obj/item/hardsuit_jetpack
- name = "hardsuit jetpack upgrade"
- icon_state = "jetpack_upgrade"
- desc = "A modular, compact set of thrusters designed to integrate with a hardsuit. It is fueled by a tank inserted into the suit's storage compartment."
- origin_tech = "materials=4;magnets=4;engineering=5"
- // Same as jetpack implant minus biotech, makes sense.
-
-
-/obj/item/hardsuit_jetpack/afterattack(var/obj/item/clothing/suit/space/hardsuit/S, mob/user)
- ..()
- if(!istype(S))
- user << "This upgrade can only be applied to a hardsuit."
- else if(S.jetpack)
- user << "[S] already has a jetpack installed."
- else if(S == user.get_item_by_slot(slot_wear_suit)) //Make sure the player is not wearing the suit before applying the upgrade.
- user << "You cannot install the upgrade to [S] while wearing it."
- else
- S.jetpack = new /obj/item/weapon/tank/jetpack/suit(S)
- user << "You successfully install the jetpack into [S]."
- qdel(src)
-
/*********************Hivelord stabilizer****************/
/obj/item/weapon/hivelordstabilizer
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index 3452702bc39..9eb0589ee6b 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -33,7 +33,7 @@
new /datum/data/mining_equipment("Fulton Pack", /obj/item/weapon/extraction_pack, 1000),
new /datum/data/mining_equipment("Lazarus Injector", /obj/item/weapon/lazarus_injector, 1000),
new /datum/data/mining_equipment("Silver Pickaxe", /obj/item/weapon/pickaxe/silver, 1000),
- new /datum/data/mining_equipment("Jetpack Upgrade", /obj/item/hardsuit_jetpack, 2000),
+ new /datum/data/mining_equipment("Jetpack Upgrade", /obj/item/weapon/tank/jetpack/suit, 2000),
new /datum/data/mining_equipment("Space Cash", /obj/item/stack/spacecash/c1000, 2000),
new /datum/data/mining_equipment("Mining Hardsuit", /obj/item/clothing/suit/space/hardsuit/mining, 2000),
new /datum/data/mining_equipment("Diamond Pickaxe", /obj/item/weapon/pickaxe/diamond, 2000),
@@ -94,7 +94,7 @@
else
dat += "No ID inserted. Insert ID.
"
dat += ""
- dat += "
Equipment point cost list:
| [prize.equipment_name] | [prize.cost] | Purchase |