Working tourniquet POC

This commit is contained in:
Pao
2023-02-06 16:25:32 +01:00
parent 9633be4fc5
commit 4092fef074
10 changed files with 53 additions and 15 deletions

View File

@@ -1,14 +1,14 @@
local function addBodyLocationBefore(newLocation, movetoLocation)
local function addBodyLocationBefore(new_location, move_to_location)
-- FIXME This doesn't really move a body location, it just re-adds it to another index. Find a way to remove it entirely (maybe setExclusive?)
local group = BodyLocations.getGroup("Human")
local list = getClassFieldVal(group, getClassField(group, 1))
group:getOrCreateLocation(newLocation)
group:getOrCreateLocation(new_location)
local newItem = list:get(list:size()-1)
print("TOC: Created new body location" .. newItem:getId())
list:remove(list:size()-1)
local i = group:indexOf(movetoLocation)
list:remove(newItem) -- We can't use the Index, it works if we pass the item though!
local i = group:indexOf(move_to_location)
list:add(i, newItem)
end