Fix Structure offset inside another structure

This commit is contained in:
JappaWakka 2023-05-13 19:58:12 +02:00
parent ba2a970b11
commit c8cf5caeac
1 changed files with 7 additions and 1 deletions

View File

@ -584,6 +584,10 @@
replaceString = "{""position""{intarr[" replaceString = "{""position""{intarr["
End If End If
If line.ToLower().Contains("{""offset""{sngarr[") = True Then
replaceString = "{""offset""{sngarr["
End If
If replaceString <> "" Then If replaceString <> "" Then
Dim positionString As String = line.Remove(0, line.ToLower().IndexOf(replaceString)) Dim positionString As String = line.Remove(0, line.ToLower().IndexOf(replaceString))
positionString = positionString.Remove(positionString.IndexOf("]}}") + 3) positionString = positionString.Remove(positionString.IndexOf("]}}") + 3)
@ -596,8 +600,10 @@
If line.ToLower().Contains("{""position""{sngarr[") = True Then If line.ToLower().Contains("{""position""{sngarr[") = True Then
line = line.Replace(positionString, "{""position""{sngarr[" & newPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & newPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & newPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & "]}}") line = line.Replace(positionString, "{""position""{sngarr[" & newPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & newPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & newPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & "]}}")
Else ElseIf line.ToLower().Contains("{""position""{intarr[") = True Then
line = line.Replace(positionString, "{""position""{intarr[" & CInt(newPosition.X).ToString().Replace(GameController.DecSeparator, ".") & "," & CInt(newPosition.Y).ToString().Replace(GameController.DecSeparator, ".") & "," & CInt(newPosition.Z).ToString().Replace(GameController.DecSeparator, ".") & "]}}") line = line.Replace(positionString, "{""position""{intarr[" & CInt(newPosition.X).ToString().Replace(GameController.DecSeparator, ".") & "," & CInt(newPosition.Y).ToString().Replace(GameController.DecSeparator, ".") & "," & CInt(newPosition.Z).ToString().Replace(GameController.DecSeparator, ".") & "]}}")
Else
line = line.Replace(positionString, "{""offset""{sngarr[" & newPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & newPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & newPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & "]}}")
End If End If
End If End If