#486 fixed pcall messages for newer CC versions

This commit is contained in:
Mikayla Fischler 2024-05-14 20:00:34 -04:00
parent 50a9168b06
commit 8968ebede3
2 changed files with 5 additions and 5 deletions

View File

@ -25,8 +25,8 @@ local RPS_LIMITS = const.RPS_LIMITS
-- I sure hope the devs don't change this error message, not that it would have safety implications
-- I wish they didn't change it to be like this
local PCALL_SCRAM_MSG = "pcall: Scram requires the reactor to be active."
local PCALL_START_MSG = "pcall: Reactor is already active."
local PCALL_SCRAM_MSG = "Scram requires the reactor to be active."
local PCALL_START_MSG = "Reactor is already active."
---@type plc_config
local config = {}
@ -307,7 +307,7 @@ function plc.rps_init(reactor, is_formed)
log.info("RPS: reactor SCRAM")
reactor.scram()
if reactor.__p_is_faulted() and (reactor.__p_last_fault() ~= PCALL_SCRAM_MSG) then
if reactor.__p_is_faulted() and not string.find(reactor.__p_last_fault(), PCALL_SCRAM_MSG) then
log.error("RPS: failed reactor SCRAM")
return false
else
@ -325,7 +325,7 @@ function plc.rps_init(reactor, is_formed)
log.info("RPS: reactor start")
reactor.activate()
if reactor.__p_is_faulted() and (reactor.__p_last_fault() ~= PCALL_START_MSG) then
if reactor.__p_is_faulted() and not string.find(reactor.__p_last_fault(), PCALL_START_MSG) then
log.error("RPS: failed reactor start")
else
self.reactor_enabled = true

View File

@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.7.10"
local R_PLC_VERSION = "v1.7.11"
local println = util.println
local println_ts = util.println_ts