mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Merge pull request #6079 from PsiOmegaDelta/PipeDrop
Allows clicking floors to drop pipes
This commit is contained in:
@@ -189,7 +189,12 @@ Buildable meters
|
|||||||
icon_state = islist[pipe_type + 1]
|
icon_state = islist[pipe_type + 1]
|
||||||
|
|
||||||
//called when a turf is attacked with a pipe item
|
//called when a turf is attacked with a pipe item
|
||||||
// place the pipe on the turf, setting pipe level to 1 (underfloor) if the turf is not intact
|
/obj/item/pipe/afterattack(turf/simulated/floor/target, mob/user, proximity)
|
||||||
|
if(!proximity) return
|
||||||
|
if(istype(target))
|
||||||
|
user.drop_from_inventory(src, target)
|
||||||
|
else
|
||||||
|
return ..()
|
||||||
|
|
||||||
// rotate the pipe item clockwise
|
// rotate the pipe item clockwise
|
||||||
|
|
||||||
|
|||||||
@@ -85,15 +85,18 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
/mob/proc/drop_from_inventory(var/obj/item/W)
|
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
|
||||||
if(W)
|
if(W)
|
||||||
|
if(!Target)
|
||||||
|
Target = loc
|
||||||
|
|
||||||
if(client) client.screen -= W
|
if(client) client.screen -= W
|
||||||
u_equip(W)
|
u_equip(W)
|
||||||
if(!W) return 1 // self destroying objects (tk, grabs)
|
if(!W) return 1 // self destroying objects (tk, grabs)
|
||||||
W.layer = initial(W.layer)
|
W.layer = initial(W.layer)
|
||||||
W.loc = loc
|
W.loc = Target
|
||||||
|
|
||||||
var/turf/T = get_turf(loc)
|
var/turf/T = get_turf(Target)
|
||||||
if(isturf(T))
|
if(isturf(T))
|
||||||
T.Entered(W)
|
T.Entered(W)
|
||||||
|
|
||||||
@@ -316,4 +319,3 @@
|
|||||||
if (del_on_fail)
|
if (del_on_fail)
|
||||||
del(W)
|
del(W)
|
||||||
return equipped
|
return equipped
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user