Skip to content

Commit

Permalink
fix being poly not being able to shoot, fix errors in homunculus.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
bgkillas committed Dec 4, 2024
1 parent e2347c4 commit 99ff29c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion noita-proxy/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 7 additions & 4 deletions quant.ew/files/system/homunculus/homunculus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion quant.ew/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99ff29c

Please sign in to comment.