Странно или не странно, но функции таковой нет, и в функции движении коняшко тоже.
Показать кусок кода? Проследи в нем, как вычисляются "v71 + v62" (они в конце этой функции).
Даже третью часть этой маеты переписывать на ERM лично у меня совершенно нет желания.
signed int __thiscall sub_0040E2C0(void *this, int a2, int a3)
{
int v3; // esi@1
int v5; // eax@3
int v6; // ebx@3
int v7; // edi@3
int v8; // ecx@4
int v9; // eax@7
signed int v10; // edx@7
int v11; // ebx@7
int v12; // edi@7
int v13; // edx@9
__int16 v14; // ax@9
int v15; // ecx@11
char v16; // al@11
_MainStruct_ *v17; // edx@14
int v18; // ecx@14
char *v19; // eax@16
int v20; // eax@21
_MapItem_ *v21; // eax@21
_TownSetup_ *v22; // eax@22
int v23; // eax@24
int v24; // edi@24
int v25; // ebx@30
int v26; // edx@32
int v27; // eax@36
_MapItem_ *v28; // eax@36
int v29; // eax@40
int v30; // ecx@40
char *v31; // edi@40
int v32; // eax@40
__int16 v33; // dx@44
int v34; // ebx@44
int v35; // eax@45
int v36; // eax@46
_MapItem_ *v37; // eax@46
_TownSetup_ *v38; // eax@47
int v39; // eax@49
int v40; // eax@55
_MapItem_ *v41; // eax@55
int i; // eax@59
int v43; // ecx@59
int v44; // edi@59
int v45; // esi@59
int v46; // edx@60
int v47; // ecx@62
int v48; // ecx@62
int v49; // eax@64
int j; // eax@70
int v51; // ecx@70
int v52; // edx@71
int k; // eax@76
int v54; // ecx@76
int v55; // edx@77
int v56; // eax@80
int v57; // ecx@80
char v58; // al@82
int v59; // eax@83
int v60; // ecx@83
int v61; // eax@87
signed int v62; // eax@89
int v63; // ebx@94
_Hero_ *v64; // eax@95
int v65; // eax@97
int v66; // eax@103
int v67; // ecx@103
char v68; // zf@106
int v69; // ecx@110
int v70; // eax@113
int v71; // ecx@119
int v72; // eax@122
_MouseMan_ *v73; // ecx@122
int v74; // [sp+Ch] [bp-10h]@80
_DWORD v75[2]; // [sp+14h] [bp-8h]@10
v3 = (int)this;
if ( !IsThisGamer2((int)PlayerStructPo) )
return sub_0040DE10(v3, a2, (_PlayerSetup_ *)a3);
v7 = a2;
v6 = a3;
v5 = *(_DWORD *)(*(_DWORD *)(v3 + 68) + 80);
if ( a2 < *(_WORD *)(v5 + 24)
|| (v8 = *(_WORD *)(v5 + 26), a2 >= v8 + *(_WORD *)(v5 + 28))
|| a3 < v8
|| a3 >= v8 + *(_WORD *)(v5 + 30) )
{
v73 = pMouseManager;
v72 = pMouseManager->CursorCadre;
if ( v72 >= 32 && v72 <= 39 )
{
sub_0050D700((int)&a2, (int)&a3);
if ( a2 >= 0 && a2 < 800 && a3 >= 0 && a3 < 600 && (a2 < 16 || a2 > 784 || a3 < 16 || a3 > 584) )
goto LABEL_134;
v73 = pMouseManager;
}
SetMouseCursor(v73, 0, 1);
LABEL_134:
sub_00403010(*(void **)(v3 + 68), v7, v6);
return 1;
}
v10 = ((unsigned __int64)a3 >> 32) & 0x1F;
v9 = *(_DWORD *)(v3 + 236);
v12 = a2 / 32;
v11 = a3 / 32;
if ( v9 == a2 / 32 && *(_DWORD *)(v3 + 240) == v11 )
return 1;
LOWORD(v9) = *(_WORD *)(v3 + 232);
LOWORD(v10) = *(_WORD *)(v3 + 228) << 6;
*(_DWORD *)(v3 + 64) = -1;
*(_DWORD *)(v3 + 236) = v12;
*(_DWORD *)(v3 + 240) = v11;
v13 = v9 ^ ((_WORD)v9 ^ (unsigned __int16)(v12 + (v10 >> 6))) & 0x3FF;
LOWORD(v9) = *(_WORD *)(v3 + 230);
*(_WORD *)(v3 + 232) = v13;
v14 = *(_WORD *)(v3 + 234) ^ (*(_WORD *)(v3 + 234) ^ (v11 + (v9 << 6 >> 6))) & 0x3FF;
LOWORD(v13) = *(_WORD *)(v3 + 230);
*(_WORD *)(v3 + 234) = v14 ^ (v14 ^ (4 * v13 >> 2)) & 0x3C00;
if ( !IsOntheMapViewPart(v3 + 232)
|| (v75[0] = *(_DWORD *)(v3 + 232),
!((unsigned __int8)GetVisibleWordByXY(
(signed __int16)(LOWORD(v75[0]) << 6) >> 6,
(signed __int16)(HIWORD(v75[0]) << 6) >> 6,
(signed __int16)(4 * HIWORD(v75[0])) >> 12) & (unsigned __int8)PlayerNumBit))
|| ((v75[0] = *(_DWORD *)(v3 + 232), v16 = IsOntheMapViewPart((int)v75), v15 = *(_DWORD *)(v3 + 92), v16) ? (a2 = GetMapItemPoByXY(v15, (signed __int16)(LOWORD(v75[0]) << 6) >> 6, (signed __int16)(HIWORD(v75[0]) << 6) >> 6, (signed __int16)(4 * HIWORD(v75[0])) >> 12)) : (a2 = *(_DWORD *)(v15 + 208)),
(FindHint4MapObject(v3, v11, v12, v3, a2, v12, v11),
v18 = PlayerStructPo->ActiveHero,
v17 = Main_Structure,
v18 != -1)
&& (v18 != -1 ? (v19 = (char *)&Main_Structure->Heroes[v18]) : (v19 = 0),
*((_WORD *)v19 + 2) != (signed __int16)(4 * *(_WORD *)(v3 + 234)) >> 12)) )
goto NotThisMapLevel;
if ( v18 == -1 )
{
if ( *(_DWORD *)(a2 + 30) == 98 )
{
v21 = sub_004FD0F0((_MapItem_ *)a2);
v20 = GetRealSetupDwordOfMapItem(v21);
v17 = Main_Structure;
if ( v20 == -1 )
v22 = 0;
else
v22 = &Main_Structure->Towns[v20];
v23 = v22->Owner;
v24 = CurrentPlayer;
if ( v23 >= 0
&& CurrentPlayer >= 0
&& Main_Structure->Map.PlayerTeam[v23] == Main_Structure->Map.PlayerTeam[CurrentPlayer]
|| *(_BYTE *)(v3 + 61) )
{
SetMouseCursor(pMouseManager, 3, 1);
*(_DWORD *)(v3 + 64) = 3;
return 1;
}
}
else
{
v24 = CurrentPlayer;
}
v25 = *(_DWORD *)(a2 + 30);
if ( v25 != 34
|| (*(_DWORD *)a2 != -1 ? (v26 = (int)&v17->Heroes[*(_DWORD *)a2]) : (v26 = 0), *(_BYTE *)(v26 + 34) != v24) )
{
if ( v25 == 87 )
{
v28 = sub_004FD0F0((_MapItem_ *)a2);
v27 = GetRealSetupDwordOfMapItem(v28) << 24 >> 24;
if ( v27 >= 0 )
{
if ( CurrentPlayer >= 0
&& Main_Structure->Map.PlayerTeam[v27] == Main_Structure->Map.PlayerTeam[CurrentPlayer] )
{
LABEL_58:
SetMouseCursor(pMouseManager, 6, 1);
*(_DWORD *)(v3 + 64) = 8;
return 1;
}
}
}
goto NotThisMapLevel;
}
IsOwnerOfHero:
SetMouseCursor(pMouseManager, 2, 1);
*(_DWORD *)(v3 + 64) = 2;
return 1;
}
v30 = 585 * v18;
v31 = (char *)Main_Structure->Heroes + 2 * v30;
v32 = *(_DWORD *)((char *)v75 + 2) ^ (HIWORD(v75[0]) ^ *(&Main_Structure->Heroes[0].y + v30)) & 0x3FF;
BYTE1(v32) &= 0xC3u;
v29 = ((*((_BYTE *)&Main_Structure->Heroes[0].l + 2 * v30) & 0xF) << 10) | v32;
if ( !(((unsigned __int16)((*(_WORD *)v31 ^ LOWORD(v75[0])) & 0x3FF ^ LOWORD(v75[0])) ^ *(_WORD *)(v3 + 232)) & 0x3FF)
&& !(((_WORD)v29 ^ *(_WORD *)(v3 + 234)) & 0x3FF)
&& !(((_WORD)v29 ^ *(_WORD *)(v3 + 234)) & 0x3C00) )
goto IsOwnerOfHero;
v34 = a2;
v33 = *(_WORD *)(a2 + 12);
if ( HIBYTE(v33) & 1 )
{
v35 = *(_DWORD *)(a2 + 30);
if ( v35 == 98 )
{
v37 = sub_004FD0F0((_MapItem_ *)a2);
v36 = GetRealSetupDwordOfMapItem(v37);
if ( v36 == -1 )
v38 = 0;
else
v38 = &Main_Structure->Towns[v36];
v39 = v38->Owner;
if ( v39 >= 0
&& CurrentPlayer >= 0
&& Main_Structure->Map.PlayerTeam[v39] == Main_Structure->Map.PlayerTeam[CurrentPlayer]
|| *(_BYTE *)(v3 + 61) )
{
SetMouseCursor(pMouseManager, 3, 1);
*(_DWORD *)(v3 + 64) = 5;
return 1;
}
}
else
{
if ( v35 == 87 )
{
v41 = sub_004FD0F0((_MapItem_ *)a2);
v40 = GetRealSetupDwordOfMapItem(v41) << 24 >> 24;
if ( v40 >= 0 )
{
if ( CurrentPlayer >= 0
&& Main_Structure->Map.PlayerTeam[v40] == Main_Structure->Map.PlayerTeam[CurrentPlayer] )
goto LABEL_58;
}
}
}
v44 = AccessableSquaresStruct + 72;
v43 = *(_DWORD *)(AccessableSquaresStruct + 80);
v45 = *(_DWORD *)(AccessableSquaresStruct + 76);
for ( i = v43; i != v43; v45 += 4 )
{
v46 = *(_DWORD *)i;
i += 4;
*(_DWORD *)v45 = v46;
}
goto LABEL_78;
}
v48 = *(int *)((char *)&Main_Structure->Heroes[0].TempMod + 2 * v30);
v47 = v48 & 0x40000;
if ( !v47 )
{
if ( *(_BYTE *)(a2 + 4) == 8 )
{
v49 = *(_DWORD *)(a2 + 30);
if ( v49 != 34 || !(HIBYTE(v33) & 0x10) )
{
if ( (v49 != 8 || !(HIBYTE(v33) & 0x10)) && (v49 != 85 || !(HIBYTE(v33) & 0x10)) )
{
v44 = AccessableSquaresStruct + 72;
v51 = *(_DWORD *)(AccessableSquaresStruct + 80);
v45 = *(_DWORD *)(AccessableSquaresStruct + 76);
for ( j = v51; j != v51; v45 += 4 )
{
v52 = *(_DWORD *)j;
j += 4;
*(_DWORD *)v45 = v52;
}
LABEL_78:
nullsub_4(v45, *(_DWORD *)(v44 + 8));
*(_DWORD *)(v44 + 8) = v45;
NotThisMapLevel:
SetMouseCursor(pMouseManager, 0, 1);
return 1;
}
}
}
}
if ( v47 && *(_BYTE *)(a2 + 4) != 8 && *(_DWORD *)(a2 + 30) != 3 )
{
v44 = AccessableSquaresStruct + 72;
v54 = *(_DWORD *)(AccessableSquaresStruct + 80);
v45 = *(_DWORD *)(AccessableSquaresStruct + 76);
for ( k = v54; k != v54; v45 += 4 )
{
v55 = *(_DWORD *)k;
k += 4;
*(_DWORD *)v45 = v55;
}
goto LABEL_78;
}
sub_00419400((void *)v3, *(_DWORD *)(v3 + 232));
v56 = *(_DWORD *)(v3 + 232);
v74 = *(_DWORD *)(v3 + 232);
a2 = *(_DWORD *)(AccessableSquaresStruct + 36);
v57 = a2;
if ( a2 )
v57 = a2
+ 30
* (((signed __int16)((_WORD)v56 << 6) >> 6)
+ MapSizeX
* (((signed __int16)(HIWORD(v74) << 6) >> 6) + 2 * MapSizeY * ((signed __int16)(4 * HIWORD(v74)) >> 12)));
v58 = *(_BYTE *)(v57 + 4);
a3 = 0;
if ( v58 & 1 )
{
v59 = *(_WORD *)(v57 + 24);
v60 = *(_DWORD *)(v31 + 77); // очки хода героя
if ( v59 > v60 )
{
a2 = (v59 - v60 - 1) / *(_DWORD *)(v31 + 73) + 1;
if ( a2 > 3 )
a2 = 3;
}
else
{
a2 = 0;
}
v61 = a2;
*(_DWORD *)(v3 + 64) = 1;
a3 = 6 * v61;
switch ( *(_DWORD *)(v34 + 30) )
{
case 8:
if ( *(_DWORD *)(v3 + 496) == 8 )
{
v62 = 0;
*(_DWORD *)(v3 + 64) = -1;
}
else
{
v62 = 6;
*(_DWORD *)(v3 + 64) = 1;
}
break;
case 3:
if ( *(_DWORD *)(v3 + 496) != 8 )
goto LABEL_93;
v62 = 7;
break;
default:
goto LABEL_93;
case 34:
v63 = *(_DWORD *)v34;
if ( v63 == -1 )
v64 = 0;
else
v64 = &Main_Structure->Heroes[v63];
v65 = v64->Owner;
if ( v65 < 0
|| CurrentPlayer < 0
|| Main_Structure->Map.PlayerTeam[v65] != Main_Structure->Map.PlayerTeam[CurrentPlayer] )
goto LABEL_100;
v62 = 8;
*(_DWORD *)(v3 + 64) = 1;
break;
case 54:
LABEL_100:
v62 = 5;
break;
case 33:
if ( !(*(_BYTE *)(v34 + 13) & 0x10)
|| (v66 = (*(_DWORD *)v34 << 6) + Main_Structure->Garrisons, v67 = *(_BYTE *)v66, v67 >= 0)
&& CurrentPlayer >= 0
&& Main_Structure->Map.PlayerTeam[v67] == Main_Structure->Map.PlayerTeam[CurrentPlayer] )
goto LABEL_93;
v68 = HasObjectGuards((_MonArr_ *)(v66 + 4)) == 0;
goto LABEL_107;
case 98:
if ( *(_DWORD *)v34 == -1 )
v69 = 0;
else
v69 = (int)&Main_Structure->Towns[*(_DWORD *)v34];
if ( !(*(_BYTE *)(v34 + 13) & 0x10)
|| (v70 = *(_BYTE *)(v69 + 1), v70 >= 0)
&& CurrentPlayer >= 0
&& Main_Structure->Map.PlayerTeam[v70] == Main_Structure->Map.PlayerTeam[CurrentPlayer] )
goto LABEL_93;
v68 = sub_005BE3E0(v69) == 0; // есть ли охрана объекта
LABEL_107:
if ( v68 )
LABEL_93:
v62 = CheckForWMinVisibleMap(v3, v34);// тип курсора
else
v62 = 5;
break;
}
}
else
{
v62 = 0;
}
if ( *(_DWORD *)(v3 + 496) != 8 || (v71 = a2, v62 != 28) )
v71 = a3; // прибавка, которая как раз и ставит правильное смещение в кадрах дефа курсора (считай т.н. дни)
SetMouseCursor(pMouseManager, v71 + v62, 1); // создание курсора-коняшки
return 1;
}