Merge pull request #11477 from Arkatos1/smartoutput

Smartfridge gets smarter
This commit is contained in:
variableundefined
2019-05-17 19:18:01 +08:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -595,3 +595,11 @@ Class Procs:
emp_act(EMP_LIGHT)
else
ex_act(EXPLODE_HEAVY)
/obj/machinery/proc/adjust_item_drop_location(atom/movable/AM) // Adjust item drop location to a 3x3 grid inside the tile, returns slot id from 0 to 8
var/md5 = md5(AM.name) // Oh, and it's deterministic too. A specific item will always drop from the same slot.
for (var/i in 1 to 32)
. += hex2num(md5[i])
. = . % 9
AM.pixel_x = -8 + ((.%3)*8)
AM.pixel_y = -8 + (round( . / 3)*8)
@@ -373,6 +373,7 @@
for(var/obj/O in contents)
if(O.name == K)
O.forceMove(loc)
adjust_item_drop_location(O)
update_icon()
i--
if(i <= 0)