Skip to content

Commit

Permalink
VA_Init1 calls "Initilize RobertsmaniaReplay plugin" but doesnt wait …
Browse files Browse the repository at this point in the history
…for it to return and runs it at the end of VA_Init1.

Add check for null elements in g_CarIdxTimeLapPosition array when reseting data.
Check for carIdx < 0 in NotInWorldPositionCheck.
  • Loading branch information
Robertsmania committed Sep 12, 2023
1 parent def2e07 commit 18266a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion RobertsmaniaReplay/VAPlugin_RobertsmaniaReplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ private static void ResetTrackPositionData()
{
g_CarIdxTimeLapPositions[i].Clear();
}
else
{
g_CarIdxTimeLapPositions[i] = new List<TimeLapPosition>();
}
}
}

Expand Down Expand Up @@ -1186,6 +1190,10 @@ public static bool TrackSurfacesCheck(TrackSurfaces trackSurface)

public static bool NotInWorldPositionCheck(int carIdx)
{
if (carIdx < 0)
{
return false;
}
return g_CurrentSessionTime - g_CarIdxNotInWorldTimes[carIdx] > cNotInWorldTimeoutSecs;
}

Expand Down Expand Up @@ -1595,7 +1603,6 @@ public static void VA_Init1(dynamic vaProxy)
//note that in this version, you can get and set the VoiceAttack variables directly.

_vaProxy = vaProxy;
_vaProxy.Command.Execute("Initialize RobertsmaniaReplay plugin", true, true, null);

if (_iRSDKWrapper == null)
{
Expand All @@ -1615,6 +1622,8 @@ public static void VA_Init1(dynamic vaProxy)
{
g_Drivers[i] = new DriverEntry(0, 0);
}

_vaProxy.Command.Execute("Initialize RobertsmaniaReplay plugin", false, true, null);
}
#endregion

Expand Down

0 comments on commit 18266a2

Please sign in to comment.