These are not compatible data types:
const char* cannot be directly converted to
char[] and vice-versa
This part
>>char Head[8] = "H3FRESH";
is allocated on the stack and goes out of context once you exit the LoHook, it will either give very bad result or work if you are lucky.
Better would be something like:
Load:
- Код: Выделить всё
if (strcmp((char*)c->esi, "H3FRESH") == 0) // strcmp returns '0' if two strings are identical
{
.... // set a flag to know this is a freshmod save
}
return EXEC_DEFAULT;
Save:
- Код: Выделить всё
strcpy((char*)c->esi, "H3FRESH");
return EXEC_DEFAULT;
Alex raises a good point about save compatibility being questionable decision but for user practicality it's simpler if that makes any sense (:
My solution for SoD_SP+ when I have over 255 mines / garrisons is to change the game header a bit. SoD_SP+ saves are invisible when you don't have SoD_SP, but appear fine when you do.
Pretty much the same way as you don't see HotA and WoG saves from SoD.