diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index aa3cca9b903..94901ae26a5 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -286,16 +286,16 @@ if(new_amount < 0 || new_amount % 1) stack_trace("Tried to set a bad stack amount: [new_amount]") return 0 - + // Clean up the new amount new_amount = max(round(new_amount), 0) - + // Can exceed max if you really want if(new_amount > max_amount && !no_limits) new_amount = max_amount - + amount = new_amount - + // Can set it to 0 without qdel if you really want if(amount == 0 && !no_limits) qdel(src) @@ -320,7 +320,7 @@ if (isnull(tamount)) tamount = src.get_amount() - + if(tamount < 0 || tamount % 1) stack_trace("Tried to transfer a bad stack amount: [tamount]") return 0 @@ -333,7 +333,10 @@ if (prob(transfer/orig_amount * 100)) transfer_fingerprints_to(S) if(blood_DNA) - S.blood_DNA |= blood_DNA + if(S.blood_DNA) + S.blood_DNA |= blood_DNA + else + S.blood_DNA = blood_DNA.Copy() return transfer return 0 @@ -347,7 +350,7 @@ if(tamount < 0 || tamount % 1) stack_trace("Tried to split a bad stack amount: [tamount]") return null - + var/transfer = max(min(tamount, src.amount, initial(max_amount)), 0) var/orig_amount = src.amount diff --git a/code/game/objects/items/weapons/material/whetstone.dm b/code/game/objects/items/weapons/material/whetstone.dm index dd0437198c7..08e99551000 100644 --- a/code/game/objects/items/weapons/material/whetstone.dm +++ b/code/game/objects/items/weapons/material/whetstone.dm @@ -9,7 +9,7 @@ w_class = ITEMSIZE_SMALL var/repair_amount = 5 var/repair_time = 40 - + /obj/item/weapon/whetstone/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/stack/material)) var/obj/item/stack/material/M = I @@ -43,7 +43,7 @@ . = ..() . += "There [uses == 1 ? "is" : "are"] [uses] [material] [uses == 1 ? src.material.sheet_singular_name : src.material.sheet_plural_name] left for use." -/obj/item/weapon/material/sharpeningkit/Initialize() +/obj/item/weapon/material/sharpeningkit/New() . = ..() setrepair() @@ -74,4 +74,4 @@ to_chat(user, "There's not enough spare sheets to sharpen [M]. You need [M.w_class*2] [M.material.sheet_plural_name].") return else - to_chat(user, "You can't sharpen [W] with [src]!") + to_chat(user, "You can't sharpen [W] with [src]!")