From 51d7989e6f75ab6de69c057ce387bbb7a944f5ba Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Sun, 25 Sep 2022 12:35:10 -0400
Subject: [PATCH] might as well JUMP! (#19088)
---
code/modules/clothing/shoes/magboots.dm | 7 +++++--
code/modules/clothing/shoes/miscellaneous.dm | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm
index f66c407a633..f319aa13f50 100644
--- a/code/modules/clothing/shoes/magboots.dm
+++ b/code/modules/clothing/shoes/magboots.dm
@@ -284,8 +284,11 @@
return
var/atom/target = get_edge_target_turf(user, user.dir) //gets the user's direction
-
- if(user.throw_at(target, jumpdistance, jumpspeed, spin = FALSE, diagonals_first = TRUE))
+ var/do_callback = FALSE
+ if(!user.flying)
+ user.flying = TRUE
+ do_callback = TRUE
+ if(user.throw_at(target, jumpdistance, jumpspeed, spin = FALSE, diagonals_first = TRUE, callback = do_callback ? VARSET_CALLBACK(user, flying, FALSE) : null))
playsound(src, 'sound/effects/stealthoff.ogg', 50, 1, 1)
user.visible_message("[usr] dashes forward into the air!")
recharging_time = world.time + recharging_rate
diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm
index a898b9d893e..9c3ffda1c39 100644
--- a/code/modules/clothing/shoes/miscellaneous.dm
+++ b/code/modules/clothing/shoes/miscellaneous.dm
@@ -388,8 +388,11 @@
return
var/atom/target = get_edge_target_turf(user, user.dir) //gets the user's direction
-
- if (user.throw_at(target, jumpdistance, jumpspeed, spin = FALSE, diagonals_first = TRUE))
+ var/do_callback = FALSE
+ if(!user.flying)
+ user.flying = TRUE
+ do_callback = TRUE
+ if(user.throw_at(target, jumpdistance, jumpspeed, spin = FALSE, diagonals_first = TRUE, callback = do_callback ? VARSET_CALLBACK(user, flying, FALSE) : null))
playsound(src, 'sound/effects/stealthoff.ogg', 50, 1, 1)
user.visible_message("[usr] dashes forward into the air!")
recharging_time = world.time + recharging_rate