diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index ae0788fc1e..6c544c4497 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -317,7 +317,8 @@ step(src, AM.dir) ..() -/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin=TRUE, diagonals_first = FALSE, var/datum/callback/callback) +/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin=TRUE, diagonals_first = FALSE, var/datum/callback/callback) //If this returns FALSE then callback will not be called. + . = FALSE if (!target || (flags_1 & NODROP_1) || speed <= 0) return @@ -346,7 +347,9 @@ //then lets add it to speed speed += user_momentum if (speed <= 0) - return //no throw speed, the user was moving too fast. + return//no throw speed, the user was moving too fast. + + . = TRUE // No failure conditions past this point. var/datum/thrownthing/TT = new() TT.thrownthing = src diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 081362ee9d..026b011e39 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -195,22 +195,24 @@ var/jumping = FALSE //are we mid-jump? /obj/item/clothing/shoes/bhop/ui_action_click(mob/user, action) - if(!isliving(usr)) + if(!isliving(user)) return if(jumping) return if(recharging_time > world.time) - to_chat(usr, "The boot's internal propulsion needs to recharge still!") + to_chat(user, "The boot's internal propulsion needs to recharge still!") return - var/atom/target = get_edge_target_turf(usr, usr.dir) //gets the user's direction + var/atom/target = get_edge_target_turf(user, user.dir) //gets the user's direction - jumping = TRUE - playsound(src.loc, 'sound/effects/stealthoff.ogg', 50, 1, 1) - usr.visible_message("[usr] dashes forward into the air!") - usr.throw_at(target, jumpdistance, jumpspeed, spin=0, diagonals_first = 1, callback = CALLBACK(src, .proc/hop_end)) + if (user.throw_at(target, jumpdistance, jumpspeed, spin = FALSE, diagonals_first = TRUE, callback = CALLBACK(src, .proc/hop_end))) + jumping = TRUE + playsound(src, 'sound/effects/stealthoff.ogg', 50, 1, 1) + user.visible_message("[usr] dashes forward into the air!") + else + to_chat(user, "Something prevents you from dashing forward!") /obj/item/clothing/shoes/bhop/proc/hop_end() jumping = FALSE