From 99ff29c71557f9387444eb87177a674c3a800a84 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Tue, 3 Dec 2024 22:05:55 -0500 Subject: [PATCH] fix being poly not being able to shoot, fix errors in homunculus.lua --- noita-proxy/src/net.rs | 2 +- quant.ew/files/system/homunculus/homunculus.lua | 11 +++++++---- quant.ew/init.lua | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index f2479e7f..1306d942 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -367,7 +367,7 @@ impl NetManager { if let Some(n) = &self.init_settings.modmanager_settings.game_save_path { - let res = get_mods(&n); + let res = get_mods(n); if let Ok(mods) = res { self.send( src, diff --git a/quant.ew/files/system/homunculus/homunculus.lua b/quant.ew/files/system/homunculus/homunculus.lua index 1cfd8532..4c1ed315 100644 --- a/quant.ew/files/system/homunculus/homunculus.lua +++ b/quant.ew/files/system/homunculus/homunculus.lua @@ -9,10 +9,12 @@ local function get_entities(entity) end local luuki = {} for _, child in ipairs(EntityGetWithTag("lukki") or {}) do - local var = EntityGetComponent(child, "VariableStorageComponent")[2] - if var ~= nil then - if ComponentGetValue2(var, "value_int") == entity then - table.insert(luuki, child) + if EntityHasTag(child, "perk_entity") then + local var = EntityGetComponent(child, "VariableStorageComponent")[2] + if var ~= nil then + if ComponentGetValue2(var, "value_int") == entity then + table.insert(luuki, child) + end end end end @@ -44,6 +46,7 @@ function rpc.send_positions(ho, lu) value_int = ctx.rpc_player_data.entity, }) EntityRemoveComponent(n, EntityGetFirstComponent(n, "LuaComponent")) + EntityAddTag(n, "perk_entity") util.make_ephemerial(n) end end diff --git a/quant.ew/init.lua b/quant.ew/init.lua index 5a8932ff..ce122811 100755 --- a/quant.ew/init.lua +++ b/quant.ew/init.lua @@ -146,7 +146,7 @@ end function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, position_y, target_x, target_y, send_message, unknown1, multicast_index, unknown3) - if shooter_id == ctx.my_player.entity then + if shooter_id == ctx.my_player.entity and EntityHasTag(shooter_id, "player_unit") then local inventory_component = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "Inventory2Component") if inventory_component == nil then return