mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Merge pull request #27790 from DamianX/PowerDatumClean
power connection datum cleanup
This commit is contained in:
@@ -58,7 +58,6 @@
|
|||||||
hook_media_sources()
|
hook_media_sources()
|
||||||
if(on)
|
if(on)
|
||||||
update_on()
|
update_on()
|
||||||
power_connection.power_changed.Add(src,"cable_power_change")
|
|
||||||
power_connection.connect()
|
power_connection.connect()
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
|||||||
@@ -144,13 +144,6 @@
|
|||||||
|
|
||||||
parent_area.use_power(amount, chan)
|
parent_area.use_power(amount, chan)
|
||||||
|
|
||||||
// called whenever the power settings of the containing area change
|
|
||||||
// by default, check equipment channel & set flag
|
|
||||||
// can override if needed
|
|
||||||
/datum/power_connection/proc/power_change()
|
|
||||||
//parent.power_change()
|
|
||||||
return
|
|
||||||
|
|
||||||
// connect the machine to a powernet if a node cable is present on the turf
|
// connect the machine to a powernet if a node cable is present on the turf
|
||||||
/datum/power_connection/proc/connect()
|
/datum/power_connection/proc/connect()
|
||||||
var/turf/T = get_turf(parent)
|
var/turf/T = get_turf(parent)
|
||||||
@@ -244,14 +237,8 @@
|
|||||||
var/idle_usage=1 // watts
|
var/idle_usage=1 // watts
|
||||||
var/active_usage=2
|
var/active_usage=2
|
||||||
|
|
||||||
var/event/power_changed = null
|
|
||||||
|
|
||||||
/datum/power_connection/consumer/New(var/loc,var/obj/parent)
|
/datum/power_connection/consumer/New(var/loc,var/obj/parent)
|
||||||
..(loc,parent)
|
..(loc,parent)
|
||||||
power_changed = new ("owner"=src)
|
|
||||||
|
|
||||||
/datum/power_connection/consumer/power_change()
|
|
||||||
INVOKE_EVENT(power_changed,list("consumer"=src))
|
|
||||||
|
|
||||||
/datum/power_connection/consumer/process()
|
/datum/power_connection/consumer/process()
|
||||||
if(use)
|
if(use)
|
||||||
@@ -269,10 +256,6 @@
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/datum/power_connection/consumer/proc/set_enabled(var/value)
|
|
||||||
enabled=value
|
|
||||||
power_change()
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
/// TERMINAL RECEIVER
|
/// TERMINAL RECEIVER
|
||||||
|
|||||||
Reference in New Issue
Block a user