Moved the list of active drug pids to sfallgv.sav.

Fixed item_d_load_subfix in the previous commit.
This commit is contained in:
NovaRain
2019-03-06 09:30:24 +08:00
parent 3934a804f4
commit 2d38b4bac1
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -290,6 +290,7 @@ static void __declspec(naked) item_d_load_subfix() {
__asm {
sub esp, 4; // proto buf
// mov [ebp], edi; // edi->queue_drug
xor ebp, ebp; // set drug_pid = 0
mov ecx, 9; // vanilla count
mov esi, FO_VAR_drugInfoList;
mov ebx, 12;
@@ -313,7 +314,6 @@ nextDrug:
lea esi, [esi + ebx];
dec ecx;
jnz loopDrug;
xor ebp, ebp; // set drug_pid = 0
cmp ebx, 12;
jnz end; // failed, this drug effect was not found
// try find in new drugs
+2 -2
View File
@@ -129,6 +129,7 @@ static void _stdcall SaveGame2() {
WriteFile(h, &data, 4, &size, 0);
Perks::save(h);
script::SaveArrays(h);
BugFixes::DrugsSaveFix(h);
CloseHandle(h);
} else {
goto errorSave;
@@ -138,7 +139,6 @@ static void _stdcall SaveGame2() {
h = CreateFileA(buf, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
if (h != INVALID_HANDLE_VALUE) {
Worldmap::SaveData(h);
BugFixes::DrugsSaveFix(h);
CloseHandle(h);
} else {
goto errorSave;
@@ -226,6 +226,7 @@ static bool LoadGame_Before() {
ReadFile(h, &data, 4, &size, 0);
Worldmap::SetAddedYears(data >> 16);
if (size != 4 || !Perks::load(h) || script::LoadArrays(h)) goto errorLoad;
if (BugFixes::DrugsLoadFix(h)) goto errorLoad;
CloseHandle(h);
} else {
dlogr("Cannot open sfallgv.sav - assuming non-sfall save.", DL_MAIN);
@@ -236,7 +237,6 @@ static bool LoadGame_Before() {
h = CreateFileA(buf, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (h != INVALID_HANDLE_VALUE) {
if (Worldmap::LoadData(h)) goto errorLoad;
if (BugFixes::DrugsLoadFix(h)) goto errorLoad;
CloseHandle(h);
} else {
dlogr("Cannot open sfalldb.sav.", DL_MAIN);
+1 -1
View File
@@ -494,7 +494,7 @@ void sf_get_object_ai_data(OpcodeContext& ctx) {
value = arrayId;
break;
default:
ctx.printOpcodeError("get_object_ai_data() - invalid AI parameter.");
ctx.printOpcodeError("get_object_ai_data() - invalid value for AI argument.");
}
ctx.setReturn(value, DataType::INT);
}