fix parameter ordering in Shavit_GetReplayBotIndex

This commit is contained in:
rtldg 2021-05-23 16:03:22 +00:00
parent 36c395dde7
commit fc37d22f1d
2 changed files with 9 additions and 4 deletions

View File

@ -1461,11 +1461,11 @@ native float Shavit_GetReplayBotFirstFrame(int entity);
/** /**
* Retrieve the replay bot's entity index. * Retrieve the replay bot's entity index.
* *
* @param track Trakc you want. -1 if you want the central bot. If no central bot, the first bot it finds it used.
* @param style Style you want. -1 if you want the central bot. If no central bot, the first bot it finds it used. * @param style Style you want. -1 if you want the central bot. If no central bot, the first bot it finds it used.
* @param track Track you want. -1 if you want the central bot. If no central bot, the first bot it finds it used.
* @return Client index for the replay bot. -1 if not found. * @return Client index for the replay bot. -1 if not found.
*/ */
native int Shavit_GetReplayBotIndex(int track, int style); native int Shavit_GetReplayBotIndex(int style, int track);
/** /**
* Retrieve the style being played by the replay bot. * Retrieve the style being played by the replay bot.

View File

@ -764,8 +764,13 @@ public int Native_GetReplayBotCurrentFrame(Handle handler, int numParams)
public int Native_GetReplayBotIndex(Handle handler, int numParams) public int Native_GetReplayBotIndex(Handle handler, int numParams)
{ {
int track = GetNativeCell(1); int style = GetNativeCell(1);
int style = GetNativeCell(2); int track = -1;
if (numParams > 1)
{
track = GetNativeCell(2);
}
if (track == -1 && style == -1 && gI_CentralBot > 0) if (track == -1 && style == -1 && gI_CentralBot > 0)
{ {