mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
[MIRROR] Glass bottles with reagents can be used for crafting, empty ones will be used as tools if possible [MDB IGNORE] (#22044)
* Glass bottles with reagents can be used for crafting, empty ones will be used as tools if possible (#76259) ## About The Pull Request Fixes #76250 The problem was a glass bottle has `tool_behaviour = rollingpin` and so it took priority in this if condition https://github.com/tgstation/tgstation/blob/93d4b6d6cd3b160989960f9f88c27640ab06ba2d/code/datums/components/crafting/crafting.dm#L125-L134 before it could check if its a reagent container Now the priority is inverted, if the glass bottle has reagents inside it then it is used as a reagent container else if it is empty then it used as a rolling pin(i.e. checks for its tool behaviours) ## Changelog 🆑 fix: glass bottles with reagents can be used for crafting, empty glass bottles will be used as tools(e.g. empty glass bottle as rolling pin) fix: glass bottle with welding fuel can be used for crafting improvised shotgun shells /🆑 * Glass bottles with reagents can be used for crafting, empty ones will be used as tools if possible --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
This commit is contained in:
@@ -122,23 +122,19 @@
|
||||
if(isstack(item))
|
||||
var/obj/item/stack/stack = item
|
||||
.["other"][item.type] += stack.amount
|
||||
else if(item.tool_behaviour)
|
||||
.["tool_behaviour"] += item.tool_behaviour
|
||||
.["other"][item.type] += 1
|
||||
else
|
||||
if(is_reagent_container(item))
|
||||
var/obj/item/reagent_containers/container = item
|
||||
if(container.is_drainable())
|
||||
for(var/datum/reagent/reagent in container.reagents.reagent_list)
|
||||
.["other"][reagent.type] += reagent.volume
|
||||
else if(is_reagent_container(item) && item.is_drainable() && length(item.reagents.reagent_list)) //some container that has some reagents inside it that can be drained
|
||||
var/obj/item/reagent_containers/container = item
|
||||
for(var/datum/reagent/reagent as anything in container.reagents.reagent_list)
|
||||
.["other"][reagent.type] += reagent.volume
|
||||
else //a reagent container that is empty can also be used as a tool. e.g. glass bottle can be used as a rolling pin
|
||||
if(item.tool_behaviour)
|
||||
.["tool_behaviour"] += item.tool_behaviour
|
||||
.["other"][item.type] += 1
|
||||
else if (ismachinery(object))
|
||||
LAZYADDASSOCLIST(.["machinery"], object.type, object)
|
||||
else if (isstructure(object))
|
||||
LAZYADDASSOCLIST(.["structures"], object.type, object)
|
||||
|
||||
|
||||
|
||||
/// Returns a boolean on whether the tool requirements of the input recipe are satisfied by the input source and surroundings.
|
||||
/datum/component/personal_crafting/proc/check_tools(atom/source, datum/crafting_recipe/recipe, list/surroundings)
|
||||
if(!length(recipe.tool_behaviors) && !length(recipe.tool_paths))
|
||||
|
||||
Reference in New Issue
Block a user