mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
@@ -184,11 +184,9 @@
|
|||||||
if(!uses_charge)
|
if(!uses_charge)
|
||||||
amount -= used
|
amount -= used
|
||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
spawn(0) //delete the empty stack once the current context yields
|
if(usr)
|
||||||
if (amount <= 0) //check again in case someone transferred stuff to us
|
usr.remove_from_mob(src)
|
||||||
if(usr)
|
qdel(src) //should be safe to qdel immediately since if someone is still using this stack it will persist for a little while longer
|
||||||
usr.remove_from_mob(src)
|
|
||||||
qdel(src)
|
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
if(get_amount() < used)
|
if(get_amount() < used)
|
||||||
|
|||||||
@@ -87,6 +87,9 @@
|
|||||||
|
|
||||||
/obj/item/weapon/gripper/no_use //Used when you want to hold and put items in other things, but not able to 'use' the item
|
/obj/item/weapon/gripper/no_use //Used when you want to hold and put items in other things, but not able to 'use' the item
|
||||||
|
|
||||||
|
/obj/item/weapon/gripper/no_use/attack_self(mob/user as mob)
|
||||||
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gripper/no_use/loader //This is used to disallow building with metal.
|
/obj/item/weapon/gripper/no_use/loader //This is used to disallow building with metal.
|
||||||
name = "sheet loader"
|
name = "sheet loader"
|
||||||
desc = "A specialized loading device, designed to pick up and insert sheets of materials inside machines."
|
desc = "A specialized loading device, designed to pick up and insert sheets of materials inside machines."
|
||||||
@@ -101,9 +104,6 @@
|
|||||||
return wrapped.attack_self(user)
|
return wrapped.attack_self(user)
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/item/weapon/gripper/no_use/attack_self(mob/user as mob)
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/gripper/verb/drop_item()
|
/obj/item/weapon/gripper/verb/drop_item()
|
||||||
|
|
||||||
set name = "Drop Item"
|
set name = "Drop Item"
|
||||||
@@ -130,6 +130,8 @@
|
|||||||
force_holder = wrapped.force
|
force_holder = wrapped.force
|
||||||
wrapped.force = 0.0
|
wrapped.force = 0.0
|
||||||
wrapped.attack(M,user)
|
wrapped.attack(M,user)
|
||||||
|
if(deleted(wrapped))
|
||||||
|
wrapped = null
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -733,17 +733,13 @@
|
|||||||
|
|
||||||
if (usr.stat != 0)
|
if (usr.stat != 0)
|
||||||
return
|
return
|
||||||
if (holdingitems && holdingitems.len == 0)
|
if (!holdingitems || holdingitems.len == 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
for(var/obj/item/O in holdingitems)
|
for(var/obj/item/O in holdingitems)
|
||||||
O.loc = src.loc
|
O.loc = src.loc
|
||||||
holdingitems -= O
|
holdingitems -= O
|
||||||
holdingitems = list()
|
holdingitems.Cut()
|
||||||
|
|
||||||
/obj/machinery/reagentgrinder/proc/remove_object(var/obj/item/O)
|
|
||||||
holdingitems -= O
|
|
||||||
qdel(O)
|
|
||||||
|
|
||||||
/obj/machinery/reagentgrinder/proc/grind()
|
/obj/machinery/reagentgrinder/proc/grind()
|
||||||
|
|
||||||
@@ -766,10 +762,6 @@
|
|||||||
// Process.
|
// Process.
|
||||||
for (var/obj/item/O in holdingitems)
|
for (var/obj/item/O in holdingitems)
|
||||||
|
|
||||||
if(!O || !istype(O))
|
|
||||||
holdingitems -= null
|
|
||||||
continue
|
|
||||||
|
|
||||||
var/remaining_volume = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
var/remaining_volume = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||||
if(remaining_volume <= 0)
|
if(remaining_volume <= 0)
|
||||||
break
|
break
|
||||||
@@ -780,13 +772,16 @@
|
|||||||
var/amount_to_take = max(0,min(stack.amount,round(remaining_volume/REAGENTS_PER_SHEET)))
|
var/amount_to_take = max(0,min(stack.amount,round(remaining_volume/REAGENTS_PER_SHEET)))
|
||||||
if(amount_to_take)
|
if(amount_to_take)
|
||||||
stack.use(amount_to_take)
|
stack.use(amount_to_take)
|
||||||
|
if(deleted(stack))
|
||||||
|
holdingitems -= stack
|
||||||
beaker.reagents.add_reagent(sheet_reagents[stack.type], (amount_to_take*REAGENTS_PER_SHEET))
|
beaker.reagents.add_reagent(sheet_reagents[stack.type], (amount_to_take*REAGENTS_PER_SHEET))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if(O.reagents)
|
if(O.reagents)
|
||||||
O.reagents.trans_to(beaker, min(O.reagents.total_volume, remaining_volume))
|
O.reagents.trans_to(beaker, min(O.reagents.total_volume, remaining_volume))
|
||||||
if(O.reagents.total_volume == 0)
|
if(O.reagents.total_volume == 0)
|
||||||
remove_object(O)
|
holdingitems -= O
|
||||||
|
qdel(O)
|
||||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user