Skip to content

Commit

Permalink
protolathes take power, fixes weird idle issue from process() on /mac…
Browse files Browse the repository at this point in the history
…hinery/
  • Loading branch information
Thera-Pissed committed Jan 11, 2024
1 parent 196a237 commit 9582cb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Class Variables:
power_channel (num)
What channel to draw from when drawing power for power mode
Possible Values:
AREA_USAGE_EQUIP:0 -- Equipment Channel
AREA_USAGE_EQUIP:1 -- Equipment Channel
AREA_USAGE_LIGHT:2 -- Lighting Channel
AREA_USAGE_ENVIRON:3 -- Environment Channel
Expand Down Expand Up @@ -180,8 +180,10 @@ Class Procs:
/obj/machinery/proc/locate_machinery()
return

/obj/machinery/process()//If you dont use process or power why are you here
return PROCESS_KILL
/obj/machinery/process()
if(!use_power) //machines without process() set would bug and not draw idle, this checks if they draw power
return PROCESS_KILL
return

/obj/machinery/proc/process_atmos()//If you dont use process why are you here
return PROCESS_KILL
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mining/machine_redemption.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
icon = 'icons/obj/machines/orm.dmi' // WS Edit - Directional ORM Sprites
icon_state = "ore_redemption"
density = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = IDLE_DRAW_MEDIUM
input_dir = NORTH
output_dir = SOUTH
layer = BELOW_OBJ_LAYER
Expand Down
8 changes: 6 additions & 2 deletions code/modules/research/machinery/_production.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name = "technology fabricator"
desc = "Makes researched and prototype items with materials and energy."
layer = BELOW_OBJ_LAYER
use_power = IDLE_POWER_USE
idle_power_usage = IDLE_DRAW_LOW
active_power_usage = ACTIVE_DRAW_HIGH
power_channel = AREA_USAGE_EQUIP
var/consoleless_interface = FALSE //Whether it can be used without a console.
var/efficiency_coeff = 1 //Materials needed / coeff = actual.
var/list/categories = list()
Expand Down Expand Up @@ -142,11 +146,11 @@
if(materials.on_hold())
say("Mineral access is on hold, please contact the quartermaster.")
return FALSE
var/power = 1000
var/power = active_power_usage
amount = clamp(amount, 1, 50)
for(var/M in D.materials)
power += round(D.materials[M] * amount / 35)
power = min(3000, power)
power = min(ACTIVE_DRAW_EXTREME, power)
use_power(power)
var/coeff = efficient_with(D.build_path) ? efficiency_coeff : 1
var/list/efficient_mats = list()
Expand Down

0 comments on commit 9582cb3

Please sign in to comment.