mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Should be able to recover from WSE crashes now
This commit is contained in:
parent
e4acb7b6af
commit
38eb84bd28
1 changed files with 18 additions and 5 deletions
|
@ -18,16 +18,29 @@ function module.on_world_initialized()
|
||||||
ewext.init_particle_world_state(grid_world, chunk_map, material_list)
|
ewext.init_particle_world_state(grid_world, chunk_map, material_list)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function oh_another_world_state(entity)
|
||||||
|
print("Another world state: "..entity)
|
||||||
|
GamePrint("Another World State Entity detected")
|
||||||
|
GamePrint("Do a 'mods > restart with enabled mods' to avoid a crash")
|
||||||
|
ewext.make_ephemerial(entity)
|
||||||
|
end
|
||||||
|
|
||||||
function module.on_local_player_spawn()
|
function module.on_local_player_spawn()
|
||||||
|
initial_world_state_entity = GameGetWorldStateEntity()
|
||||||
|
for _, ent in ipairs(EntityGetWithTag("world_state")) do
|
||||||
|
if ent ~= GameGetWorldStateEntity() then
|
||||||
|
oh_another_world_state(ent)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EntitySetTransform(GameGetWorldStateEntity(), 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function module.on_world_update()
|
function module.on_world_update()
|
||||||
if GameGetWorldStateEntity() ~= initial_world_state_entity then
|
if GameGetWorldStateEntity() ~= initial_world_state_entity then
|
||||||
GamePrint("Whoops WSE is different "..GameGetWorldStateEntity().." "..initial_world_state_entity)
|
-- -- EntityKill(GameGetWorldStateEntity())
|
||||||
ewext.make_ephemerial(GameGetWorldStateEntity())
|
-- ewext.load_world_state()
|
||||||
-- EntityKill(GameGetWorldStateEntity())
|
oh_another_world_state(GameGetWorldStateEntity())
|
||||||
ewext.load_world_state()
|
initial_world_state_entity = GameGetWorldStateEntity()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue