World sync reset on NG+

This commit is contained in:
IQuant 2024-08-21 21:57:19 +03:00
parent fbb0de1538
commit 334556f80d
2 changed files with 3 additions and 0 deletions

View file

@ -523,6 +523,7 @@ impl NetManager {
self.world_info.update_player_pos(peer_id, x, y);
}
}
Some("reset_world") => state.world.reset(),
key => {
error!("Unknown msg from mod: {:?}", key)
}

View file

@ -17,6 +17,7 @@ function rpc.gather_and_do_ending(x, y, sx, sy)
local entity = EntityCreateNew("totally_sampo")
EntitySetTransform(entity, sx, sy)
-- Emulate the following script being called from LuaComponent
local old_updated = GetUpdatedEntityID
function GetUpdatedEntityID()
return entity
@ -25,6 +26,7 @@ function rpc.gather_and_do_ending(x, y, sx, sy)
dofile("data/entities/animals/boss_centipede/ending/sampo_start_ending_sequence.lua")
GetUpdatedEntityID = old_updated
net.proxy_send("reset_world", "")
end
np.CrossCallAdd("ew_ending_sequence", function(sx, sy, sampo_ent)