- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
if ((AnalysisType == 0) || (!m_UseExtraInfo)) {
o1 = o2 = -1;
do {
fseek(F, o1, SEEK_END); Buf[0] = fgetc(F);
if ((Buf[0] == 0xFF) || ((Buf[0] == 0x7F) && (AnalysisType == 0))) {
o2 = o1; o1--; FFcnt = 1;
do {
fseek(F, o1, SEEK_END); Buf[0] = fgetc(F);
if ((Buf[0] == 0xFF) || ((Buf[0] == 0x7F) && (AnalysisType == 0)))
FFcnt++;
o1--;
}
while ((Buf[0] == 0xFF) || ((Buf[0] == 0x7F) && (AnalysisType == 0)));
if ((FFcnt == 71) || (FFcnt == 73)) PosTavern = o2;
if ((PosCheater == -1) && (FFcnt > 50)) {
PosCheater = o2; fseek(F, o2, SEEK_END);
do {
Buf[0] = fgetc(F);
if (Buf[0] != 0x00) PosCheater++;
}
while (Buf[0] != 0x00);
}
}
else o1--;
}
while ((o1 > -sz) &&
(((AnalysisType == 1) && (PosTavern == -1)) ||
((AnalysisType == 0) && (PosCheater == -1))));
}
else {
o1 = o2 = -200;
oFFcnt = -1;
do {
fseek(F, o1, SEEK_END);
Buf[0] = fgetc(F); Buf[1] = fgetc(F);
if ((Buf[0] == HL) && (Buf[1] == HR)) {
o2 = o1 + 86;
FFcnt = 0;
do {
fseek(F, o2, SEEK_END);
Buf[0] = fgetc(F);
if (Buf[0] == 0xFF) {
FFcnt++; o2--;
}
}
while (Buf[0] == 0xFF);
if ((oFFcnt == -1) || (abs(72 - FFcnt) < abs(72 - oFFcnt))) {
PosTavern = o1; oFFcnt = FFcnt;
}
}
o1--;
}
while (o1 > -sz);
if (PosTavern != -1)
PosTavern = PosTavern + 86 + 0x91 * (7 - PN);
if (m_ChangeHeroes && ((HL_new >= 0) || (HR_new >= 0))) {
o1 = o2 = -1;
do {
fseek(F, o1, SEEK_END); Buf[0] = fgetc(F);
if ((Buf[0] == 0xFF) || (Buf[0] == 0x7F)) {
o2 = o1; o1--; FFcnt = 1;
do {
fseek(F, o1, SEEK_END); Buf[0] = fgetc(F);
if ((Buf[0] == 0xFF) || (Buf[0] == 0x7F)) FFcnt++;
o1--;
}
while ((Buf[0] == 0xFF) || (Buf[0] == 0x7F));
if (FFcnt > 50) {
PosCheater = o2; fseek(F, o2, SEEK_END);
do {
Buf[0] = fgetc(F);
if (Buf[0] != 0x00) PosCheater++;
}
while (Buf[0] != 0x00);
}
}
else o1--;
}
while ((o1 > -sz) && (PosCheater == -1));
}
}
Кустарно-мистический анализатор сейвов для Героев 3.
Так я писал пять с половиной лет назад...