diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm index 02b89d5cd51..4728e0ad868 100644 --- a/code/game/objects/items/weapons/tanks/jetpack.dm +++ b/code/game/objects/items/weapons/tanks/jetpack.dm @@ -153,3 +153,23 @@ turn_off() return ..() + + +//Return a jetpack that the mob can use +//Back worn jetpacks, hardsuit internal packs, and so on. +//Used in Process_Spacemove() and wherever you want to check for/get a jetpack + +/mob/proc/get_jetpack() + return + +/mob/living/carbon/get_jetpack() + var/obj/item/weapon/tank/jetpack/J = back + if(istype(J)) + return J + +/mob/living/carbon/human/get_jetpack() + var/obj/item/weapon/tank/jetpack/J = ..() + if(!istype(J) && istype(wear_suit, /obj/item/clothing/suit/space/hardsuit)) + var/obj/item/clothing/suit/space/hardsuit/C = wear_suit + J = C.jetpack + return J \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f35f90877f9..d556b547fca 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -35,6 +35,18 @@ if((src.disabilities & FAT) && src.m_intent == "run" && src.bodytemperature <= 360) src.bodytemperature += 2 + +/mob/living/carbon/Process_Spacemove(movement_dir = 0) + if(..()) + return 1 + if(!isturf(loc)) // In a mecha? A locker? Who knows! + return 0 + + var/obj/item/weapon/tank/jetpack/J = get_jetpack() + if(istype(J) && J.allow_thrust(0.01, src)) + return 1 + + /mob/living/carbon/movement_delay() . = ..() if(legcuffed) @@ -832,3 +844,6 @@ var/const/GALOSHES_DONT_HELP = 4 user << "You retrieve some of [src]\'s internal organs!" ..() + + + diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 1772751126d..f2723f7bd5c 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -3,19 +3,6 @@ . += ..() . += config.human_delay -/mob/living/carbon/human/Process_Spacemove(movement_dir = 0) - if(..()) - return 1 - if(!isturf(loc)) // In a mecha? A locker? Who knows! - return 0 - - // Do we have a jetpack (and is it on)? - var/obj/item/weapon/tank/jetpack/J = back - if(!istype(J) && istype(wear_suit, /obj/item/clothing/suit/space/hardsuit)) - var/obj/item/clothing/suit/space/hardsuit/C = wear_suit - J = C.jetpack - if(istype(J) && J.allow_thrust(0.01, src)) - return 1 /mob/living/carbon/human/slip(s_amount, w_amount, obj/O, lube) if(isobj(shoes) && (shoes.flags&NOSLIP) && !(lube&GALOSHES_DONT_HELP)) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7d78d0a2e66..8046e9cb6fe 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -728,8 +728,7 @@ Sorry Giacom. Please don't be mad :( animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) floating = 1 else if(((!on || fixed) && floating)) - var/final_pixel_y = get_standard_pixel_y_offset(lying) - animate(src, pixel_y = final_pixel_y, time = 10) + animate(src, pixel_y = get_standard_pixel_y_offset(lying), time = 10) floating = 0 //called when the mob receives a bright flash