mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2024-12-04 09:43:00 +02:00
Add clear error message for someone trying to re-init the mod on a save.
This commit is contained in:
parent
d1ca209d86
commit
f9ae63f229
@ -1,4 +1,9 @@
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 2.1.5
|
||||
Date: 2024-11-01
|
||||
Changes:
|
||||
- Provide a clear error message that it is NOT supported if the mod is removed and re-added.
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 2.1.4
|
||||
Date: 2024-10-29
|
||||
Bugfixes:
|
||||
|
@ -42,6 +42,14 @@ require("lib/oarc_tests")
|
||||
-- On Init - Only runs once the first time the game starts
|
||||
--------------------------------------------------------------------------------
|
||||
script.on_init(function(event)
|
||||
|
||||
-- If init has already been run, we immediately hard error.
|
||||
-- This is NOT supported. Checking for this force is just an easy dumb way to do it.
|
||||
if (game.forces[ABANDONED_FORCE_NAME] ~= nil) then
|
||||
error("It appears as though this mod is trying to re-run on_init. If you removed the mod and re-added it again, this is NOT supported. You have to rollback to a previous save where the mod was enabled.")
|
||||
return
|
||||
end
|
||||
|
||||
ValidateAndLoadConfig()
|
||||
RegrowthInit()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user