Skip to content

Commit 6ba3ece

Browse files
committed
fix controls being enabled when notplayer from texting
1 parent eb89c1c commit 6ba3ece

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

noita-proxy/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ impl App {
12281228
let mut old_settings = netman.settings.lock().unwrap().clone();
12291229
old_settings.progress.clear();
12301230
old_settings.seed = new_settings.seed;
1231+
old_settings.world_num = new_settings.world_num;
12311232
netman
12321233
.dirty
12331234
.store(old_settings != new_settings, Ordering::Relaxed)

quant.ew/files/system/text/text.lua

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,30 @@ end
9999

100100
local function starttext()
101101
enabled = true
102-
local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent")
103102
local g = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "InventoryGuiComponent")
104103
if g ~= nil then
105104
EntitySetComponentIsEnabled(ctx.my_player.entity, g, false)
106105
end
107-
if controls ~= nil then
108-
ComponentSetValue2(controls, "enabled", false)
106+
if not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then
107+
local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent")
108+
if controls ~= nil then
109+
ComponentSetValue2(controls, "enabled", false)
110+
end
109111
end
110112
end
111113

112114
local function stoptext()
113115
enabled = false
114116
text = ""
115-
local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent")
116117
local g = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "InventoryGuiComponent")
117118
if g ~= nil then
118119
EntitySetComponentIsEnabled(ctx.my_player.entity, g, true)
119120
end
120-
if controls ~= nil then
121-
ComponentSetValue2(controls, "enabled", true)
121+
if not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then
122+
local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent")
123+
if controls ~= nil then
124+
ComponentSetValue2(controls, "enabled", true)
125+
end
122126
end
123127
end
124128

@@ -162,4 +166,4 @@ function module.on_world_update()
162166
end
163167
end
164168

165-
return module
169+
return module

0 commit comments

Comments
 (0)