mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 07:27:57 +01:00
Merge pull request #11477 from Arkatos1/smartoutput
Smartfridge gets smarter
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user