Code:
How to find the index with IDA
1. open engine module
2. string search "@%.03f:loss(%.05f)" and go to its only xref which is cl_move
3. create pseudo
if ( v32 <= 0.0 )
{
if ( v30 <= 0.0 )
{
if ( dword_1058B414 & 0x1000 )
goto LABEL_57;
if ( *(_DWORD *)(dword_1058B41C + 36) )
v14 = *(BYTE **)(dword_1058B41C + 36);
if ( *v14 )
LABEL_57:
(*(void (__stdcall **)(BYTE *))(*(_DWORD *)dword_1058B41C + 56))(&Data);
}
else
{
v21 = sub_10027F70(v19, (int)&v26, (int)"@%.03f:choke(%.05f)", v31);
(*(void (__stdcall **)(int))(*(_DWORD *)dword_1058B41C + 56))(v21 + 5);
}
}
else
{
v20 = sub_10027F70(v19, (int)&v26, (int)"@%.03f:loss(%.05f)", v31);
(*(void (__stdcall **)(int))(*(_DWORD *)dword_1058B41C + 56))(v20 + 5);
}
}
}
else
{
(*(void (**)(void))(**(_DWORD **)(v3 + 156) + 104))();
v11 = *(_DWORD *)(v3 + 156);
v32 = result;
(*(void (**)(void))(*(_DWORD *)v11 + 88))(); <---- this vfunc call is createmove divide the last number: 88 / 4 = 22. 22 is the current index.