Moves throw mode procs up to /mob level, clicking on a non-turf or an
atom that is not in a turf cancels throw mode.
This commit is contained in:
mwerezak
2015-07-18 23:27:09 -04:00
parent 52cc850bf8
commit 4ea1379b33
3 changed files with 22 additions and 18 deletions

View File

@@ -80,8 +80,10 @@
return return
if(in_throw_mode) if(in_throw_mode)
throw_item(A) if(isturf(A) || isturf(A.loc))
return throw_item(A)
return
throw_mode_off()
if(!istype(A,/obj/item/weapon/gun) && !isturf(A) && !istype(A,/obj/screen)) if(!istype(A,/obj/item/weapon/gun) && !isturf(A) && !istype(A,/obj/screen))
last_target_click = world.time last_target_click = world.time

View File

@@ -315,22 +315,6 @@
//Throwing stuff //Throwing stuff
/mob/living/carbon/proc/toggle_throw_mode()
if (src.in_throw_mode)
throw_mode_off()
else
throw_mode_on()
/mob/living/carbon/proc/throw_mode_off()
src.in_throw_mode = 0
if(src.throw_icon) //in case we don't have the HUD and we use the hotkey
src.throw_icon.icon_state = "act_throw_off"
/mob/living/carbon/proc/throw_mode_on()
src.in_throw_mode = 1
if(src.throw_icon)
src.throw_icon.icon_state = "act_throw_on"
/mob/proc/throw_item(atom/target) /mob/proc/throw_item(atom/target)
return return

View File

@@ -1009,3 +1009,21 @@ mob/proc/yank_out_object()
/mob/verb/westfaceperm() /mob/verb/westfaceperm()
set hidden = 1 set hidden = 1
set_face_dir(WEST) set_face_dir(WEST)
//Throwing stuff
/mob/proc/toggle_throw_mode()
if (src.in_throw_mode)
throw_mode_off()
else
throw_mode_on()
/mob/proc/throw_mode_off()
src.in_throw_mode = 0
if(src.throw_icon) //in case we don't have the HUD and we use the hotkey
src.throw_icon.icon_state = "act_throw_off"
/mob/proc/throw_mode_on()
src.in_throw_mode = 1
if(src.throw_icon)
src.throw_icon.icon_state = "act_throw_on"