Skip to content

Commit 855ee0a

Browse files
committed
surely fix item sync, fix player sync error from player cursor change, change default player arrow size to 0, since idk why it should be this large by default
1 parent 382f66d commit 855ee0a

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

noita-proxy/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl UXSettings {
408408
self.ping_lifetime.unwrap_or(5)
409409
}
410410
fn ping_scale(&self) -> f32 {
411-
self.ping_scale.unwrap_or(0.5)
411+
self.ping_scale.unwrap_or(0.0)
412412
}
413413
fn hide_cursors(self) -> bool {
414414
self.hide_cursors.unwrap_or(false)

quant.ew/files/system/item_sync.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ local function make_global(item, give_authority_to)
223223

224224
ctx.item_prevent_localize[gid] = false
225225
rpc.item_globalize(item_data)
226-
wait_on_send[gid] = nil
226+
if wait_on_send[gid] ~= nil then
227+
wait_on_send[gid] = GameGetFrameNum() + 30
228+
end
227229
end
228230

229231
function item_sync.make_item_global(item, instant, give_authority_to)
@@ -563,7 +565,9 @@ end
563565

564566
rpc.opts_reliable()
565567
function rpc.item_globalize(item_data)
566-
wait_for_gid[item_data.gid] = nil
568+
if wait_for_gid[item_data.gid] ~= nil then
569+
wait_for_gid[item_data.gid] = GameGetFrameNum() + 30
570+
end
567571
if is_safe_to_remove() then
568572
item_sync.remove_item_with_id_now(item_data.gid)
569573
end

quant.ew/files/system/player_ping/player_ping.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ function module.on_world_update()
6464

6565
local i = 1
6666
--ternary operators ahead
67-
local lifetime = (ctx.proxy_opt.ping_lifetime ~= nil and {ctx.proxy_opt.ping_lifetime} or {900})[1]*60
68-
local custom_scale = (ctx.proxy_opt.ping_scale ~= nil and {ctx.proxy_opt.ping_scale} or {0.5})[1]
67+
local lifetime = (ctx.proxy_opt.ping_lifetime ~= nil and {ctx.proxy_opt.ping_lifetime} or {5})[1]*60
68+
local custom_scale = (ctx.proxy_opt.ping_scale ~= nil and {ctx.proxy_opt.ping_scale} or {0})[1]
6969
while i <= #pings do
7070
local pos = pings[i]
7171
local frame = pos[3]

quant.ew/files/system/player_sync.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ function module.on_world_update()
109109
if ctx.my_id ~= peer_id then
110110
for _, child in ipairs(children) do
111111
if EntityGetName(child) == "cursor" and ctx.proxy_opt.hide_cursors == true then
112-
EntitySetComponentIsEnabled(child, EntityGetFirstComponent(child, "SpriteComponent"), false)
112+
local sprite = EntityGetFirstComponent(child, "SpriteComponent")
113+
if sprite ~= nil and sprite ~= 0 then
114+
EntitySetComponentIsEnabled(child, sprite, false)
115+
end
113116
else
114117
EntitySetComponentIsEnabled(child,
115118
EntityGetFirstComponentIncludingDisabled(child, "SpriteComponent"), true)

0 commit comments

Comments
 (0)