diff --git a/ModScripts/9999999999999999999999_IBRUIsland.rb b/ModScripts/9999999999999999999999_IBRUIsland.rb index 618b4e1..4eeeee8 100644 --- a/ModScripts/9999999999999999999999_IBRUIsland.rb +++ b/ModScripts/9999999999999999999999_IBRUIsland.rb @@ -226,6 +226,12 @@ if defined?(WebSocket) ibru_parse_without(message) end + alias ibru_disconnect_without disconnect unless method_defined?(:ibru_disconnect_without) + def disconnect(*args, &block) + MPIslandVoyage.set_active(false) + ibru_disconnect_without(*args, &block) + end + alias ibru_noclip_without admin_noclip_enabled? unless method_defined?(:ibru_noclip_without) def admin_noclip_enabled? MPIslandVoyage.noclip? || ibru_noclip_without @@ -263,6 +269,7 @@ if defined?(MPGodMode) alias ibru_tick_without tick unless method_defined?(:ibru_tick_without) def tick ibru_tick_without + MPIslandVoyage.tick if MPIslandVoyage.active? && WebSocket.bootstrap_sync_unlocked? && (!@ibru_hello_at || Time.now.to_f - @ibru_hello_at > 10) @ibru_hello_at = Time.now.to_f WebSocket.send_line('god_hello:1') @@ -272,19 +279,6 @@ if defined?(MPGodMode) end end -if defined?(Scene_Map) - class Scene_Map - # A script reload must not alias our own wrapper: that would recurse until - # SystemStackError on this frame's call to ibru_update_without. - alias ibru_update_without update unless method_defined?(:ibru_update_without) - def update(*args, &block) - result = ibru_update_without(*args, &block) - MPIslandVoyage.tick - result - end - end -end - # Keep the island tools in the existing VIP overlay, without granting OWNER. if defined?(Scene_Map) && Scene_Map.method_defined?(:mp_admin_open_root) class Scene_Map