Skip to content

Commit

Permalink
Merge pull request #321 from Szwagi/fix-bot-playback-not-moving
Browse files Browse the repository at this point in the history
Fix bot being stuck at 0,0,0 caused by invalid ArrayList block size
  • Loading branch information
zealain committed Apr 23, 2022
2 parents a22ea4e + 8b13c7b commit bdefa3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/sourcemod/scripting/gokz-replays/playback.sp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static bool LoadFormatVersion1Replay(File file, int bot)
// Setup playback tick data array list
if (playbackTickData[bot] == null)
{
playbackTickData[bot] = new ArrayList(RP_V1_TICK_DATA_BLOCKSIZE, length);
playbackTickData[bot] = new ArrayList(IntMax(RP_V1_TICK_DATA_BLOCKSIZE, sizeof(ReplayTickData)), length);
}
else
{ // Make sure it's all clear and the correct size
Expand Down Expand Up @@ -630,10 +630,10 @@ static bool LoadFormatVersion2Replay(File file, int client, int bot)
// Setup playback tick data array list
if (playbackTickData[bot] == null)
{
playbackTickData[bot] = new ArrayList(sizeof(ReplayTickData));
playbackTickData[bot] = new ArrayList(IntMax(RP_V1_TICK_DATA_BLOCKSIZE, sizeof(ReplayTickData)));
}
else
{ // Make sure it's all clear and the correct size
{
playbackTickData[bot].Clear();
}

Expand Down

0 comments on commit bdefa3d

Please sign in to comment.