Working tourniquet POC
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user