diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 93655cafc35..598ebf67d3e 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -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 diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 88bf4c3a851..020651ad395 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -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 diff --git a/code/modules/tables/interactions.dm b/code/modules/tables/interactions.dm index da9f5be361a..1067af69332 100644 --- a/code/modules/tables/interactions.dm +++ b/code/modules/tables/interactions.dm @@ -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 diff --git a/html/changelogs/geeves-table_alignment_fix.yml b/html/changelogs/geeves-table_alignment_fix.yml new file mode 100644 index 00000000000..6dd220ef52d --- /dev/null +++ b/html/changelogs/geeves-table_alignment_fix.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Fixed table placement alignment." \ No newline at end of file