mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-29 19:52:12 +00:00
@@ -47,23 +47,30 @@
|
||||
return
|
||||
if(!isturf(target))
|
||||
return
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
var/turf/source_turf = get_turf(I)
|
||||
var/turf/target_turf = target
|
||||
var/list/clickparams = params2list(params)
|
||||
var/x_offset = text2num(clickparams["icon-x"]) - 16
|
||||
var/y_offset = text2num(clickparams["icon-y"]) - 16
|
||||
var/x_offset
|
||||
var/y_offset
|
||||
if(target_turf != get_turf(I)) //Trying to stick it on a wall, don't move it to the actual wall or you can move the item through it. Instead set the pixels as appropriate
|
||||
var/target_direction = get_dir(source_turf, target_turf)//The direction we clicked
|
||||
// Snowflake diagonal handling
|
||||
if(target_direction in GLOB.diagonals)
|
||||
to_chat(user, "<span class='warning'>You cant reach [target_turf].</span>")
|
||||
return
|
||||
if(target_direction & EAST)
|
||||
x_offset += 32
|
||||
x_offset = 16
|
||||
y_offset = rand(-12, 12)
|
||||
else if(target_direction & WEST)
|
||||
x_offset -= 32
|
||||
if(target_direction & NORTH)
|
||||
y_offset += 32
|
||||
x_offset = -16
|
||||
y_offset = rand(-12, 12)
|
||||
else if(target_direction & NORTH)
|
||||
x_offset = rand(-12, 12)
|
||||
y_offset = 16
|
||||
else if(target_direction & SOUTH)
|
||||
y_offset -= 32
|
||||
x_offset = rand(-12, 12)
|
||||
y_offset = -16
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You stick [I] to [target_turf].</span>")
|
||||
I.pixel_x = x_offset
|
||||
I.pixel_y = y_offset
|
||||
|
||||
Reference in New Issue
Block a user