Files
Paradise/code/game/objects/items/mountable_frames/mountables.dm
FalseIncarnate 676937a1cb Mountables "rose" span removal
Removes the rose class from spans in mountables code.

More occurances of this ancient span class have been unearthed and will
be handled in a separate PR since that'd end up being unnecessary bloat
in this PR, plus some of those cases need some fixing anyways (span
without /span)
2017-08-19 01:33:23 -04:00

35 lines
966 B
Plaintext

/obj/item/mounted
var/list/buildon_types = list(/turf/simulated/wall)
/obj/item/mounted/afterattack(var/atom/A, mob/user, proximity_flag)
var/found_type = 0
for(var/turf_type in src.buildon_types)
if(istype(A, turf_type))
found_type = 1
break
if(found_type)
if(try_build(A, user, proximity_flag))
return do_build(A, user)
else
..()
/obj/item/mounted/proc/try_build(turf/on_wall, mob/user, proximity_flag) //checks
if(!on_wall || !user)
return
if(proximity_flag != 1) //if we aren't next to the wall
return
if(!( get_dir(on_wall,user) in cardinal))
to_chat(user, "<span class='warning'>You need to be standing next to a wall to place \the [src].</span>")
return
if(gotwallitem(get_turf(user), get_dir(on_wall,user)))
to_chat(user, "<span class='warning'>There's already an item on this wall!</span>")
return
return 1
/obj/item/mounted/proc/do_build(turf/on_wall, mob/user) //the buildy bit after we pass the checks
return