Skip to content

Commit

Permalink
Fixed: Error when processing attachment transform when no attachment …
Browse files Browse the repository at this point in the history
…origin is available
  • Loading branch information
dvdvideo1234 committed Mar 30, 2024
1 parent 24ff13a commit c6bbdc4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present
------------ CONFIGURE ASMLIB ------------

asmlib.InitBase("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","8.743")
asmlib.SetOpVar("TOOL_VERSION","8.744")
asmlib.SetIndexes("V" ,1,2,3)
asmlib.SetIndexes("A" ,1,2,3)
asmlib.SetIndexes("WV",1,2,3)
Expand Down
22 changes: 12 additions & 10 deletions lua/trackassembly/trackasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2281,15 +2281,17 @@ function LocatePOA(oRec, ivPoID)
LogInstance("Angle transform from model "..GetReport3(ID, sA, StringPOA(tOA.A, "A")))
end -- Transform angle is decoded from the model and stored in the cache
-------------------- Point --------------------
if(sP:sub(1,1) == sD) then -- Check whenever point is disabled
ReloadPOA(tOA.O[cvX], tOA.O[cvY], tOA.O[cvZ]) -- Override with the origin
else -- When the point is disabled take the origin otherwise try to process it
if(IsNull(sP) or IsBlank(sP)) then -- In case of empty value or null use the origin
ReloadPOA(tOA.O[cvX], tOA.O[cvY], tOA.O[cvZ]) -- Override with the origin
else -- When the point is empty use the origin otherwise decode the value
if(not DecodePOA(sP)) then LogInstance("Point mismatch "..GetReport2(ID, oRec.Slot)) end
end -- The point is already decoded and ready to be populated in the cache
end; if(not IsHere(TransferPOA(tOA.P, "V"))) then LogInstance("Point transfer fail"); return nil end
if(sP) then -- There is still comething to be processed after the registration
if(sP:sub(1,1) == sD) then -- Check whenever point is disabled
ReloadPOA(tOA.O[cvX], tOA.O[cvY], tOA.O[cvZ]) -- Override with the origin
else -- When the point is disabled take the origin otherwise try to process it
if(IsNull(sP) or IsBlank(sP)) then -- In case of empty value or null use the origin
ReloadPOA(tOA.O[cvX], tOA.O[cvY], tOA.O[cvZ]) -- Override with the origin
else -- When the point is empty use the origin otherwise decode the value
if(not DecodePOA(sP)) then LogInstance("Point mismatch "..GetReport2(ID, oRec.Slot)) end
end -- The point is already decoded and ready to be populated in the cache
end; if(not IsHere(TransferPOA(tOA.P, "V"))) then LogInstance("Point transfer fail"); return nil end
end -- Otherwise point is initialized on registration and we have nothing to do here
end -- Loop and transform all the POA configuration at once. Game model slot will be taken
end; return stPOA, iPoID
end
Expand Down Expand Up @@ -2340,7 +2342,7 @@ function RegisterPOA(stData, ivID, sP, sO, sA)
elseif(sP:sub(1,1) == sD) then -- Point is disabled
ReloadPOA(tOffs.O[cvX], tOffs.O[cvY], tOffs.O[cvZ])
else -- when the point is disabled take the origin
if(IsNull(sP) or IsBlank(sP)) then
if(IsNull(sP) or IsBlank(sP)) then -- Empty value
ReloadPOA(tOffs.O[cvX], tOffs.O[cvY], tOffs.O[cvZ])
else -- When the point is empty use the origin otherwise decode the value
if(not DecodePOA(sP)) then LogInstance("Point mismatch "..GetReport2(iID, stData.Slot)) end
Expand Down

0 comments on commit c6bbdc4

Please sign in to comment.