mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-09 03:18:25 +00:00
migrate adt_arrays to arraylist
This commit is contained in:
parent
580b886103
commit
58457674ec
@ -63,7 +63,7 @@ a bhop server should be simple
|
|||||||
- [x] Migrate every menu to the 1.7 transitional syntax.
|
- [x] Migrate every menu to the 1.7 transitional syntax.
|
||||||
- [x] Migrate DBI to the 1.7 transitional syntax.
|
- [x] Migrate DBI to the 1.7 transitional syntax.
|
||||||
- [x] Migrate events to the 1.7 transitional syntax.
|
- [x] Migrate events to the 1.7 transitional syntax.
|
||||||
- [ ] Migrate ADT_Arrays to ArrayList.
|
- [x] Migrate ADT_Arrays to ArrayList.
|
||||||
|
|
||||||
~ shavit-core:
|
~ shavit-core:
|
||||||
- [x] Fix chat colors for CS:S.
|
- [x] Fix chat colors for CS:S.
|
||||||
|
|||||||
@ -377,12 +377,12 @@ public bool LoadReplay(BhopStyle style)
|
|||||||
|
|
||||||
gA_Frames[style].Resize(++iSize);
|
gA_Frames[style].Resize(++iSize);
|
||||||
|
|
||||||
SetArrayCell(gA_Frames[style], iSize - 1, StringToFloat(sExplodedLine[0]), 0);
|
gA_Frames[style].Set(iSize - 1, StringToFloat(sExplodedLine[0]), 0);
|
||||||
SetArrayCell(gA_Frames[style], iSize - 1, StringToFloat(sExplodedLine[1]), 1);
|
gA_Frames[style].Set(iSize - 1, StringToFloat(sExplodedLine[1]), 1);
|
||||||
SetArrayCell(gA_Frames[style], iSize - 1, StringToFloat(sExplodedLine[2]), 2);
|
gA_Frames[style].Set(iSize - 1, StringToFloat(sExplodedLine[2]), 2);
|
||||||
|
|
||||||
SetArrayCell(gA_Frames[style], iSize - 1, StringToFloat(sExplodedLine[3]), 3);
|
gA_Frames[style].Set(iSize - 1, StringToFloat(sExplodedLine[3]), 3);
|
||||||
SetArrayCell(gA_Frames[style], iSize - 1, StringToFloat(sExplodedLine[4]), 4);
|
gA_Frames[style].Set(iSize - 1, StringToFloat(sExplodedLine[4]), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete hFile;
|
delete hFile;
|
||||||
@ -417,7 +417,7 @@ public void SaveReplay(BhopStyle style)
|
|||||||
|
|
||||||
for(int i = 0; i < iSize; i++)
|
for(int i = 0; i < iSize; i++)
|
||||||
{
|
{
|
||||||
FormatEx(sBuffer, 320, "%f|%f|%f|%f|%f", GetArrayCell(gA_Frames[style], i, 0), GetArrayCell(gA_Frames[style], i, 1), GetArrayCell(gA_Frames[style], i, 2), GetArrayCell(gA_Frames[style], i, 3), GetArrayCell(gA_Frames[style], i, 4));
|
FormatEx(sBuffer, 320, "%f|%f|%f|%f|%f", gA_Frames[style].Get(i, 0), gA_Frames[style].Get(i, 1), gA_Frames[style].Get(i, 2), gA_Frames[style].Get(i, 3), gA_Frames[style].Get(i, 4));
|
||||||
|
|
||||||
WriteFileLine(hFile, sBuffer);
|
WriteFileLine(hFile, sBuffer);
|
||||||
}
|
}
|
||||||
@ -546,13 +546,13 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
|||||||
gI_ReplayTick[iReplayBotStyle]++;
|
gI_ReplayTick[iReplayBotStyle]++;
|
||||||
|
|
||||||
float vecCurrentPosition[3];
|
float vecCurrentPosition[3];
|
||||||
vecCurrentPosition[0] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle] - 1, 0);
|
vecCurrentPosition[0] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle] - 1, 0);
|
||||||
vecCurrentPosition[1] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle] - 1, 1);
|
vecCurrentPosition[1] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle] - 1, 1);
|
||||||
vecCurrentPosition[2] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle] - 1, 2);
|
vecCurrentPosition[2] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle] - 1, 2);
|
||||||
|
|
||||||
float vecAngles[3];
|
float vecAngles[3];
|
||||||
vecAngles[0] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle] - 1, 3);
|
vecAngles[0] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle] - 1, 3);
|
||||||
vecAngles[1] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle] - 1, 4);
|
vecAngles[1] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle] - 1, 4);
|
||||||
|
|
||||||
float vecVelocity[3];
|
float vecVelocity[3];
|
||||||
|
|
||||||
@ -561,9 +561,9 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
|||||||
if(gA_Frames[iReplayBotStyle].Length >= gI_ReplayTick[iReplayBotStyle] + 1)
|
if(gA_Frames[iReplayBotStyle].Length >= gI_ReplayTick[iReplayBotStyle] + 1)
|
||||||
{
|
{
|
||||||
float vecNextPosition[3];
|
float vecNextPosition[3];
|
||||||
vecNextPosition[0] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle], 0);
|
vecNextPosition[0] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle], 0);
|
||||||
vecNextPosition[1] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle], 1);
|
vecNextPosition[1] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle], 1);
|
||||||
vecNextPosition[2] = GetArrayCell(gA_Frames[iReplayBotStyle], gI_ReplayTick[iReplayBotStyle], 2);
|
vecNextPosition[2] = gA_Frames[iReplayBotStyle].Get(gI_ReplayTick[iReplayBotStyle], 2);
|
||||||
|
|
||||||
fDistance = GetVectorDistance(vecPosition, vecNextPosition);
|
fDistance = GetVectorDistance(vecPosition, vecNextPosition);
|
||||||
|
|
||||||
@ -589,12 +589,12 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
|||||||
gI_PlayerFrames[client]++;
|
gI_PlayerFrames[client]++;
|
||||||
gA_PlayerFrames[client].Resize(gI_PlayerFrames[client]);
|
gA_PlayerFrames[client].Resize(gI_PlayerFrames[client]);
|
||||||
|
|
||||||
SetArrayCell(gA_PlayerFrames[client], gI_PlayerFrames[client] - 1, vecPosition[0], 0);
|
gA_PlayerFrames[client].Set(gI_PlayerFrames[client] - 1, vecPosition[0], 0);
|
||||||
SetArrayCell(gA_PlayerFrames[client], gI_PlayerFrames[client] - 1, vecPosition[1], 1);
|
gA_PlayerFrames[client].Set(gI_PlayerFrames[client] - 1, vecPosition[1], 1);
|
||||||
SetArrayCell(gA_PlayerFrames[client], gI_PlayerFrames[client] - 1, vecPosition[2], 2);
|
gA_PlayerFrames[client].Set(gI_PlayerFrames[client] - 1, vecPosition[2], 2);
|
||||||
|
|
||||||
SetArrayCell(gA_PlayerFrames[client], gI_PlayerFrames[client] - 1, angles[0], 3);
|
gA_PlayerFrames[client].Set(gI_PlayerFrames[client] - 1, angles[0], 3);
|
||||||
SetArrayCell(gA_PlayerFrames[client], gI_PlayerFrames[client] - 1, angles[1], 4);
|
gA_PlayerFrames[client].Set(gI_PlayerFrames[client] - 1, angles[1], 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user