Makes ore refineries drop materials below them when not linked to a silo (#93681)

## About The Pull Request

- What it says above, makes them drop materials instead of sending them
to the shadow realm
- Replaces some 1 argument `round()'s` with `floor()'s` in material
logic, someone should regex all of them sometime for a giant conflict
merge PR

## Why It's Good For The Game

> What it says above, makes them drop materials instead of sending them
to the shadow realm
- Makes custom-made refinery setups a bit more viable, alongside
recovering from the ore silo being bombed/eaten by a hungry boi
> Replaces some 1 argument `round()'s` with `floor()'s` in material
logic
- Round() using 1 argument is deprecated, should slowly start switching
over

## Changelog

🆑
fix: the ore refineries now drop stacks of materials below them if they
are not linked to a silo instead of being sent to the shadow realm
/🆑
This commit is contained in:
Gboster-0
2025-10-31 14:34:58 +01:00
committed by GitHub
parent 7e0ab4dd1b
commit 2f6ae1dcde
3 changed files with 8 additions and 6 deletions
@@ -245,7 +245,7 @@
if(!space_left)
return MATERIAL_INSERT_ITEM_NO_SPACE
var/material_per_sheet = material_amount / item_stack.amount
var/sheets_to_insert = round(space_left / material_per_sheet)
var/sheets_to_insert = floor(space_left / material_per_sheet)
if(!sheets_to_insert)
return MATERIAL_INSERT_ITEM_NO_SPACE
target = fast_split_stack(item_stack, sheets_to_insert)
@@ -690,7 +690,7 @@
return 0
//requested amount greater than available amount or just an invalid value
stack_amt = min(round(materials[material] / SHEET_MATERIAL_AMOUNT), stack_amt)
stack_amt = min(floor(materials[material] / SHEET_MATERIAL_AMOUNT), stack_amt)
if(stack_amt <= 0)
return 0
//auto drop location