mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +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
|
||||
/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(0) //force area power update
|
||||
|
||||
|
||||
@@ -61,7 +61,10 @@
|
||||
R.module.respawn_consumable(R)
|
||||
if(!R.cell)
|
||||
return
|
||||
R.cell.give(active_power_usage*CELLRATE)
|
||||
if(!R.cell.fully_charged())
|
||||
R.cell.give(active_power_usage*CELLRATE)
|
||||
else
|
||||
update_use_power(1)
|
||||
go_out()
|
||||
if(!( src.occupant ))
|
||||
return
|
||||
@@ -73,8 +76,7 @@
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
build_icon()
|
||||
src.use_power = 1
|
||||
use_power(0) //update area power usage
|
||||
update_use_power(1)
|
||||
return
|
||||
|
||||
|
||||
@@ -114,6 +116,5 @@
|
||||
O.loc = src.loc*/
|
||||
src.add_fingerprint(usr)
|
||||
build_icon()
|
||||
src.use_power = 2
|
||||
use_power(0) //update area power usage
|
||||
update_use_power(2)
|
||||
return
|
||||
Reference in New Issue
Block a user