mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 22:18:27 +01:00
Fixing issues
Adds a check for stacktype and a turf check, preventing bad behavior.
This commit is contained in:
@@ -3,6 +3,10 @@
|
|||||||
/obj/item/stack/proc/merge(obj/item/stack/S) //Merge src into S, as much as possible
|
/obj/item/stack/proc/merge(obj/item/stack/S) //Merge src into S, as much as possible
|
||||||
if(uses_charge || S.uses_charge) // This should realistically never happen, but in case it does lets avoid breaking things.
|
if(uses_charge || S.uses_charge) // This should realistically never happen, but in case it does lets avoid breaking things.
|
||||||
return
|
return
|
||||||
|
if(S.stacktype != stacktype)
|
||||||
|
return
|
||||||
|
if(S.amount >= S.max_amount)
|
||||||
|
return
|
||||||
|
|
||||||
var/transfer = get_amount()
|
var/transfer = get_amount()
|
||||||
transfer = min(transfer, S.max_amount - S.amount)
|
transfer = min(transfer, S.max_amount - S.amount)
|
||||||
@@ -15,6 +19,6 @@
|
|||||||
S.add(transfer)
|
S.add(transfer)
|
||||||
|
|
||||||
/obj/item/stack/Crossed(var/atom/movable/AM)
|
/obj/item/stack/Crossed(var/atom/movable/AM)
|
||||||
if(AM != src && istype(AM, src.type) && !AM.throwing)
|
if(isturf(AM.loc) && AM != src && istype(AM, src.type) && !AM.throwing)
|
||||||
merge(AM)
|
merge(AM)
|
||||||
return ..()
|
return ..()
|
||||||
Reference in New Issue
Block a user