mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
update_use_power() now doesn't force updates...
...if it doesnt need to.
This commit is contained in:
@@ -159,6 +159,9 @@ Class Procs:
|
|||||||
|
|
||||||
//sets the use_power var and then forces an area power update
|
//sets the use_power var and then forces an area power update
|
||||||
/obj/machinery/proc/update_use_power(var/new_use_power)
|
/obj/machinery/proc/update_use_power(var/new_use_power)
|
||||||
|
if (new_use_power == use_power)
|
||||||
|
return //don't need to do anything
|
||||||
|
|
||||||
use_power = new_use_power
|
use_power = new_use_power
|
||||||
use_power(0) //force area power update
|
use_power(0) //force area power update
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,10 @@
|
|||||||
R.module.respawn_consumable(R)
|
R.module.respawn_consumable(R)
|
||||||
if(!R.cell)
|
if(!R.cell)
|
||||||
return
|
return
|
||||||
|
if(!R.cell.fully_charged())
|
||||||
R.cell.give(active_power_usage*CELLRATE)
|
R.cell.give(active_power_usage*CELLRATE)
|
||||||
|
else
|
||||||
|
update_use_power(1)
|
||||||
go_out()
|
go_out()
|
||||||
if(!( src.occupant ))
|
if(!( src.occupant ))
|
||||||
return
|
return
|
||||||
@@ -73,8 +76,7 @@
|
|||||||
src.occupant.loc = src.loc
|
src.occupant.loc = src.loc
|
||||||
src.occupant = null
|
src.occupant = null
|
||||||
build_icon()
|
build_icon()
|
||||||
src.use_power = 1
|
update_use_power(1)
|
||||||
use_power(0) //update area power usage
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -114,6 +116,5 @@
|
|||||||
O.loc = src.loc*/
|
O.loc = src.loc*/
|
||||||
src.add_fingerprint(usr)
|
src.add_fingerprint(usr)
|
||||||
build_icon()
|
build_icon()
|
||||||
src.use_power = 2
|
update_use_power(2)
|
||||||
use_power(0) //update area power usage
|
|
||||||
return
|
return
|
||||||
Reference in New Issue
Block a user