mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
dont duplicate perks
This commit is contained in:
parent
0e103b3d80
commit
ac426dcd50
2 changed files with 5 additions and 3 deletions
|
@ -42,16 +42,18 @@ local function give_one_perk(entity_who_picked, perk_info, count)
|
||||||
lazyload()
|
lazyload()
|
||||||
-- add game effect
|
-- add game effect
|
||||||
if perk_info.game_effect ~= nil then
|
if perk_info.game_effect ~= nil then
|
||||||
local game_effect_comp = GetGameEffectLoadTo( entity_who_picked, perk_info.game_effect, true )
|
local game_effect_comp, ent = GetGameEffectLoadTo( entity_who_picked, perk_info.game_effect, true )
|
||||||
if game_effect_comp ~= nil then
|
if game_effect_comp ~= nil then
|
||||||
ComponentSetValue( game_effect_comp, "frames", "-1" )
|
ComponentSetValue( game_effect_comp, "frames", "-1" )
|
||||||
|
EntityAddTag( ent, "perk_entity" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if perk_info.game_effect2 ~= nil then
|
if perk_info.game_effect2 ~= nil then
|
||||||
local game_effect_comp = GetGameEffectLoadTo( entity_who_picked, perk_info.game_effect2, true )
|
local game_effect_comp, ent = GetGameEffectLoadTo( entity_who_picked, perk_info.game_effect2, true )
|
||||||
if game_effect_comp ~= nil then
|
if game_effect_comp ~= nil then
|
||||||
ComponentSetValue( game_effect_comp, "frames", "-1" )
|
ComponentSetValue( game_effect_comp, "frames", "-1" )
|
||||||
|
EntityAddTag( ent, "perk_entity" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ function effect_sync.get_ent_effects(entity)
|
||||||
local com = EntityGetFirstComponent(ent, "GameEffectComponent")
|
local com = EntityGetFirstComponent(ent, "GameEffectComponent")
|
||||||
if com ~= nil then
|
if com ~= nil then
|
||||||
local name = ComponentGetValue2(com, "effect")
|
local name = ComponentGetValue2(com, "effect")
|
||||||
if not IGNORE_EFFECTS[name] and filename ~= EntityGetFilename(ent) then
|
if not IGNORE_EFFECTS[name] and filename ~= EntityGetFilename(ent) and not EntityHasTag(ent, "perk_entity") then
|
||||||
table.insert(list, ent)
|
table.insert(list, ent)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue