Table Alignment Fix (#10917)

This commit is contained in:
Geeves
2021-01-06 18:53:42 +02:00
committed by GitHub
parent 44040a0515
commit cfbf1e6cfc
4 changed files with 19 additions and 8 deletions
+4 -1
View File
@@ -367,7 +367,7 @@
sleep(1)
animate(I, alpha = 0, transform = matrix(), time = 1)
/atom/movable/proc/do_putdown_animation(atom/target, mob/user)
/atom/movable/proc/do_putdown_animation(atom/target, mob/user, var/click_params)
if(QDELETED(src))
return
if(QDELETED(target))
@@ -393,6 +393,9 @@
viewing |= M.client
flick_overlay(I, viewing, 4)
if(istype(target, /obj/structure/table))
var/obj/structure/table/T = target
T.auto_align(src, click_params)
var/to_x = (target.x - old_turf.x) * 32 + pixel_x
var/to_y = (target.y - old_turf.y) * 32 + pixel_y
var/old_x = pixel_x
+8 -5
View File
@@ -187,15 +187,18 @@ var/list/slot_equipment_priority = list( \
// Removes an item from inventory and places it in the target atom.
// If canremove or other conditions need to be checked then use unEquip instead.
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/target)
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/target, var/click_params)
if(W)
if(!target)
target = loc
remove_from_mob(W)
if(!(W && W.loc))
return 1
INVOKE_ASYNC(W, /atom/movable/proc/do_putdown_animation, target, src)
W.forceMove(target)
INVOKE_ASYNC(W, /atom/movable/proc/do_putdown_animation, target, src, click_params)
if(istype(target, /obj/structure/table))
W.forceMove(target.loc)
else
W.forceMove(target)
update_icon()
return 1
return 0
@@ -280,10 +283,10 @@ var/list/slot_equipment_priority = list( \
return slot
//This differs from remove_from_mob() in that it checks if the item can be unequipped first.
/mob/proc/unEquip(obj/item/I, force = 0, var/atom/target) //Force overrides NODROP for things like wizarditis and admin undress.
/mob/proc/unEquip(obj/item/I, force = 0, var/atom/target, var/click_params) //Force overrides NODROP for things like wizarditis and admin undress.
if(!(force || canUnEquip(I)))
return
drop_from_inventory(I, target)
drop_from_inventory(I, target, click_params)
return 1
+1 -2
View File
@@ -201,9 +201,8 @@
return
// Placing stuff on tables
if(user.unEquip(W, 0, src.loc))
if(user.unEquip(W, 0, src, click_parameters))
user.make_item_drop_sound(W)
auto_align(W, click_parameters)
return 1
#define CELLS 8 //Amount of cells per row/column in grid
@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- bugfix: "Fixed table placement alignment."