mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
fixed bad function references in ISS
This commit is contained in:
parent
f24b214229
commit
c47f45ea46
@ -15,20 +15,49 @@ function iss_init(reactor)
|
|||||||
self.reactor = reactor
|
self.reactor = reactor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local damage_critical = function ()
|
||||||
|
return self.reactor.getDamagePercent() >= 100
|
||||||
|
end
|
||||||
|
|
||||||
|
local excess_heated_coolant = function ()
|
||||||
|
return self.reactor.getHeatedCoolantNeeded() == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local excess_waste = function ()
|
||||||
|
return self.reactor.getWasteNeeded() == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local high_temp = function ()
|
||||||
|
-- mekanism: MAX_DAMAGE_TEMPERATURE = 1_200
|
||||||
|
return self.reactor.getTemperature() >= 1200
|
||||||
|
end
|
||||||
|
|
||||||
|
local insufficient_fuel = function ()
|
||||||
|
return self.reactor.getFuel() == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local no_coolant = function ()
|
||||||
|
return self.reactor.getCoolantFilledPercentage() < 2
|
||||||
|
end
|
||||||
|
|
||||||
|
local timed_out = function ()
|
||||||
|
return self.timed_out
|
||||||
|
end
|
||||||
|
|
||||||
local check = function ()
|
local check = function ()
|
||||||
local status = "ok"
|
local status = "ok"
|
||||||
local was_tripped = self.tripped
|
local was_tripped = self.tripped
|
||||||
|
|
||||||
-- check system states in order of severity
|
-- check system states in order of severity
|
||||||
if self.damage_critical() then
|
if damage_critical() then
|
||||||
status = "dmg_crit"
|
status = "dmg_crit"
|
||||||
elseif self.high_temp() then
|
elseif high_temp() then
|
||||||
status = "high_temp"
|
status = "high_temp"
|
||||||
elseif self.excess_heated_coolant() then
|
elseif excess_heated_coolant() then
|
||||||
status = "heated_coolant_backup"
|
status = "heated_coolant_backup"
|
||||||
elseif self.excess_waste() then
|
elseif excess_waste() then
|
||||||
status = "full_waste"
|
status = "full_waste"
|
||||||
elseif self.insufficient_fuel() then
|
elseif insufficient_fuel() then
|
||||||
status = "no_fuel"
|
status = "no_fuel"
|
||||||
elseif self.tripped then
|
elseif self.tripped then
|
||||||
status = self.trip_cause
|
status = self.trip_cause
|
||||||
@ -83,35 +112,6 @@ function iss_init(reactor)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local damage_critical = function ()
|
|
||||||
return self.reactor.getDamagePercent() >= 100
|
|
||||||
end
|
|
||||||
|
|
||||||
local excess_heated_coolant = function ()
|
|
||||||
return self.reactor.getHeatedCoolantNeeded() == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
local excess_waste = function ()
|
|
||||||
return self.reactor.getWasteNeeded() == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
local high_temp = function ()
|
|
||||||
-- mekanism: MAX_DAMAGE_TEMPERATURE = 1_200
|
|
||||||
return self.reactor.getTemperature() >= 1200
|
|
||||||
end
|
|
||||||
|
|
||||||
local insufficient_fuel = function ()
|
|
||||||
return self.reactor.getFuel() == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
local no_coolant = function ()
|
|
||||||
return self.reactor.getCoolantFilledPercentage() < 2
|
|
||||||
end
|
|
||||||
|
|
||||||
local timed_out = function ()
|
|
||||||
return self.timed_out
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
reconnect_reactor = reconnect_reactor,
|
reconnect_reactor = reconnect_reactor,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user