mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 06:34:45 +01:00
Added more sanity checks to the gun code.
This commit is contained in:
@@ -277,6 +277,13 @@
|
||||
back = null
|
||||
else if (W == wear_mask)
|
||||
wear_mask = null
|
||||
if(istype(W,/obj/item/weapon/gun))
|
||||
var/obj/item/weapon/gun/gun = W
|
||||
if(gun.target)
|
||||
gun.target.NotTargeted(gun)
|
||||
del(item_use_icon)
|
||||
del(gun_move_icon)
|
||||
del(gun_run_icon)
|
||||
update_clothing()
|
||||
return
|
||||
|
||||
|
||||
@@ -589,32 +589,50 @@
|
||||
usr:module_active = null
|
||||
|
||||
if("Allow Walking")
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.AllowTargetMove()
|
||||
icon_state = "walking"
|
||||
name = "Disallow Walking"
|
||||
|
||||
if("Disallow Walking")
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.AllowTargetMove()
|
||||
icon_state = "no_walk"
|
||||
name = "Allow Walking"
|
||||
|
||||
if("Allow Running")
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.AllowTargetRun()
|
||||
icon_state = "running"
|
||||
name = "Disallow Running"
|
||||
|
||||
if("Disallow Running")
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
usr.AllowTargetRun()
|
||||
icon_state = "no_run"
|
||||
name = "Allow Running"
|
||||
|
||||
if("Allow Item Use")
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
name = "Disallow Item Use"
|
||||
icon_state = "act_throw_off"
|
||||
usr.AllowTargetClick()
|
||||
|
||||
|
||||
if("Disallow Item Use")
|
||||
if(!istype(usr.equipped(),/obj/item/weapon/gun))
|
||||
usr << "You need your gun in your active hand to do that!"
|
||||
return
|
||||
name = "Allow Item Use"
|
||||
icon_state = "no_item"
|
||||
usr.AllowTargetClick()
|
||||
|
||||
Reference in New Issue
Block a user