Skip to content

Commit

Permalink
Looms now auto-stack from adjacent tiles (#3434)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Sep 17, 2024
1 parent 620ebaa commit 0a311de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/datums/elements/loomable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
if(isstack(source))
var/obj/item/stack/stack_we_use = source
while(stack_we_use.amount >= required_amount)
combine_nearby_stacks(user, stack_we_use) // monkestation edit: automatically merge nearby stacks
if(!do_after(user, loom_time, target))
break

Expand Down
6 changes: 6 additions & 0 deletions monkestation/code/datums/elements/loomable.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/element/loomable/proc/combine_nearby_stacks(atom/target, obj/item/stack/our_stack)
for(var/obj/item/stack/nearby_stack as anything in view(1, get_turf(target)))
if(our_stack.amount >= our_stack.max_amount)
break
if(our_stack.can_merge(nearby_stack, inhand = TRUE))
nearby_stack.merge(our_stack)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5843,6 +5843,7 @@
#include "monkestation\code\datums\diseases\advance\symptoms\clockwork.dm"
#include "monkestation\code\datums\elements\area_locked.dm"
#include "monkestation\code\datums\elements\basic_eating.dm"
#include "monkestation\code\datums\elements\loomable.dm"
#include "monkestation\code\datums\elements\trash_if_empty.dm"
#include "monkestation\code\datums\elements\uncompressed_storage.dm"
#include "monkestation\code\datums\ert\moff_inspectors.dm"
Expand Down

0 comments on commit 0a311de

Please sign in to comment.