Skip to content

Commit

Permalink
item pickup qol
Browse files Browse the repository at this point in the history
  • Loading branch information
BurgerLUA committed Apr 16, 2024
1 parent 2b65fea commit 4502d94
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code/_core/obj/hud/inventory/_inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,21 @@
vis_contents += I
I.layer = LAYER_BASE + length(vis_contents)

if(I.amount < I.amount_max && is_turf(old_location))
var/turf/T = old_location
var/check_limit = 10
for(var/obj/item/O in old_location)
if(check_limit <= 0 || I.amount >= I.amount_max)
break
check_limit--
if(O == src)
continue
if(O.loc != T || O.qdeleting)
continue
if(!O.can_transfer_stacks_to(I))
continue
O.transfer_amount_to(I)

I.on_equip(old_location,silent)

if(is_item(src.loc))
Expand Down
19 changes: 19 additions & 0 deletions code/_core/obj/item/stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,26 @@
INTERACT_CHECK
INTERACT_CHECK_OBJECT
INTERACT_DELAY(1)

var/atom/old_location = I.loc

var/stacks_transfered = I.transfer_amount_to(src)

if(src.amount < src.amount_max && is_turf(old_location))
var/turf/T = old_location
var/check_limit = 10
for(var/obj/item/O in old_location)
if(check_limit <= 0 || src.amount >= src.amount_max)
break
check_limit--
if(O == I)
continue
if(O.loc != T || O.qdeleting)
continue
if(!O.can_transfer_stacks_to(src))
continue
stacks_transfered += O.transfer_amount_to(src)

if(stacks_transfered)
caller.to_chat(span("notice","You transfer [stacks_transfered] stacks to \the [src.name]."))
else
Expand Down

0 comments on commit 4502d94

Please sign in to comment.