Skip to content

Commit

Permalink
Fixed duplication of traits in character creation menu if traits were…
Browse files Browse the repository at this point in the history
… converted into a bad trait.
  • Loading branch information
badonnthedeer committed Jun 22, 2023
1 parent 44948e7 commit e0ffcef
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions media/lua/shared/NPCs/AnthroTraitsCreationMethods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,16 @@ AnthroTraitsMainCreationMethods.sortTraits = function()
do
local label = trait:getLabel()
local newItem;

--remove beforehand, since traits can not be removed
--from the other list if the new value is *-1
ccp.listboxTrait:removeItem(label)
ccp.listboxBadTrait:removeItem(label)

if tonumber(trait:getRightLabel()) < 0
then
ccp.listboxTrait:removeItem(label)
newItem = ccp.listboxTrait:addItem(label, trait)
else
ccp.listboxBadTrait:removeItem(label)
ccp.listboxBadTrait:addItem(label, trait)
end
end
Expand All @@ -258,3 +262,10 @@ end

return AnthroTraitsMainCreationMethods;

--[[
for i=1,BloodBodyPartType.MAX:index() do
local part = BloodBodyPartType.FromIndex(i-1)
if visual:getBlood(part) + visual:getDirt(part) > 0 then
units = units + 1
end
end]]

0 comments on commit e0ffcef

Please sign in to comment.