Skip to content

Commit efeb80a

Browse files
committed
sync more things, fix sun dupe
1 parent e8510a2 commit efeb80a

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed

ewext/src/modules/entity_sync/diff_model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,8 +1460,8 @@ impl RemoteDiffModel {
14601460
"data/scripts/animals/blob_damage.lua",
14611461
]
14621462
.contains(&&*lua.script_damage_received()?)
1463-
|| lua.script_source_file()?
1464-
== "data/scripts/props/suspended_container_physics_objects.lua"
1463+
|| ["data/scripts/props/suspended_container_physics_objects.lua"]
1464+
.contains(&&*lua.script_source_file()?)
14651465
{
14661466
entity.remove_component(*lua)?;
14671467
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if HasFlagPersistent("darkmoon_is_darksun") then
2+
local entity_id = GetUpdatedEntityID()
3+
local x, y = EntityGetTransform(entity_id)
4+
CrossCall("ew_moon_spawn", x, y)
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if HasFlagPersistent("moon_is_sun") then
2+
local entity_id = GetUpdatedEntityID()
3+
local x, y = EntityGetTransform(entity_id)
4+
CrossCall("ew_moon_spawn", x, y)
5+
end

quant.ew/files/system/uniq_flags/uniq_flags.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ function module.on_world_update()
7474
or f == "data/entities/props/music_machines/music_machine_02.xml"
7575
or f == "data/entities/props/music_machines/music_machine_03.xml"
7676
or f == "data/entities/animals/boss_fish/fish_giga.xml"
77+
or f == "data/entities/buildings/chest_steel.xml"
7778
then
7879
local x, y = EntityGetTransform(ent)
7980
local flag = f .. ":" .. math.floor(x / 512) .. ":" .. math.floor(y / 512)
@@ -85,4 +86,31 @@ function module.on_world_update()
8586
last = n
8687
end
8788

89+
rpc.opts_reliable()
90+
rpc.opts_everywhere()
91+
function rpc.request_moon_flag_slow(x, y, dark)
92+
if ctx.is_host then
93+
local flag = "ew_moon_spawn" .. ":" .. math.floor(x / 512) .. ":" .. math.floor(y / 512)
94+
local res = GameHasFlagRun(flag)
95+
GameAddFlagRun(flag)
96+
rpc.got_flag_moon_slow(ctx.rpc_peer_id, res, x, y, dark)
97+
end
98+
end
99+
100+
rpc.opts_reliable()
101+
rpc.opts_everywhere()
102+
function rpc.got_flag_moon_slow(peer_id, state, x, y, dark)
103+
if peer_id == ctx.my_id and not state then
104+
if dark then
105+
EntityLoad("data/entities/items/pickup/sun/newsun_dark.xml", x, y)
106+
else
107+
EntityLoad("data/entities/items/pickup/sun/newsun.xml", x, y)
108+
end
109+
end
110+
end
111+
112+
util.add_cross_call("ew_moon_spawn", function(x, y, dark)
113+
rpc.request_moon_flag_slow(x, y, dark)
114+
end)
115+
88116
return module

quant.ew/files/system/wang_hooks/wang_hooks.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ local allow_patching = {
7373
spawn_boss = true,
7474
spawn_book = true,
7575
spawn_secret = true,
76+
spawn_fruit = true,
77+
spawn_specialshop = true,
78+
spawn_rock1 = true,
79+
spawn_rock2 = true,
80+
spawn_prize = true,
81+
--spawn_chest = true,
7682
}
7783

7884
local function patch_fn(color, orig_fn_name)
@@ -176,4 +182,4 @@ util.add_cross_call("ew_wang_detour", function(file, fn, x, y, w, h, is_open_pat
176182
return false
177183
end)
178184

179-
return module
185+
return module

0 commit comments

Comments
 (0)