mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
remove some errors
This commit is contained in:
parent
749025b2ef
commit
b35db32101
2 changed files with 8 additions and 6 deletions
|
@ -120,14 +120,16 @@ function item_sync.make_item_global(item, instant)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
item_sync.ensure_notify_component(item)
|
item_sync.ensure_notify_component(item)
|
||||||
local gid_component = EntityGetFirstComponentIncludingDisabled(item, "VariableStorageComponent", "ew_global_item_id")
|
local gid_component = EntityGetFirstComponent(item, "VariableStorageComponent", "ew_global_item_id")
|
||||||
local gid = ComponentGetValue2(gid_component, "value_string")
|
local gid
|
||||||
if gid_component == nil then
|
if gid_component == nil then
|
||||||
gid = allocate_global_id()
|
gid = allocate_global_id()
|
||||||
EntityAddComponent2(item, "VariableStorageComponent", {
|
EntityAddComponent2(item, "VariableStorageComponent", {
|
||||||
_tags = "enabled_in_world,enabled_in_hand,enabled_in_inventory,ew_global_item_id",
|
_tags = "enabled_in_world,enabled_in_hand,enabled_in_inventory,ew_global_item_id",
|
||||||
value_string = gid,
|
value_string = gid,
|
||||||
})
|
})
|
||||||
|
else
|
||||||
|
gid = ComponentGetValue2(gid_component, "value_string")
|
||||||
end
|
end
|
||||||
--local vel = EntityGetFirstComponentIncludingDisabled(item, "VelocityComponent")
|
--local vel = EntityGetFirstComponentIncludingDisabled(item, "VelocityComponent")
|
||||||
--if vel then
|
--if vel then
|
||||||
|
|
|
@ -60,17 +60,17 @@ function rpc.set_cosmetics_all(id, amulet, gem, crown)
|
||||||
for peer_id, player_data in pairs(ctx.players) do
|
for peer_id, player_data in pairs(ctx.players) do
|
||||||
if peer_id == id then
|
if peer_id == id then
|
||||||
local player_entity = player_data.entity
|
local player_entity = player_data.entity
|
||||||
local player_components = EntityGetAllComponents(player_entity)
|
local player_components = EntityGetComponent(player_entity, "SpriteComponent", "character")
|
||||||
if player_components ~= nil then
|
if player_components ~= nil then
|
||||||
for _, comp in ipairs(player_components) do
|
for _, comp in ipairs(player_components) do
|
||||||
if comp == nil then
|
if comp == nil then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
if ComponentGetValue2(comp, "image_file") == "data/enemies_gfx/player_amulet.xml" and amulet then
|
if amulet and ComponentGetValue2(comp, "image_file") == "data/enemies_gfx/player_amulet.xml" then
|
||||||
EntitySetComponentIsEnabled(player_entity, comp, false)
|
EntitySetComponentIsEnabled(player_entity, comp, false)
|
||||||
elseif ComponentGetValue2(comp, "image_file") == "data/enemies_gfx/player_amulet_gem.xml" and gem then
|
elseif gem and ComponentGetValue2(comp, "image_file") == "data/enemies_gfx/player_amulet_gem.xml" then
|
||||||
EntitySetComponentIsEnabled(player_entity, comp, false)
|
EntitySetComponentIsEnabled(player_entity, comp, false)
|
||||||
elseif ComponentGetValue2(comp, "image_file") == "data/enemies_gfx/player_hat2.xml" and crown then
|
elseif crown and ComponentGetValue2(comp, "image_file") == "data/enemies_gfx/player_hat2.xml" then
|
||||||
EntitySetComponentIsEnabled(player_entity, comp, false)
|
EntitySetComponentIsEnabled(player_entity, comp, false)
|
||||||
end
|
end
|
||||||
::continue::
|
::continue::
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue