mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Moved the list of active drug pids to sfallgv.sav.
Fixed item_d_load_subfix in the previous commit.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -214,7 +214,7 @@ static DWORD getBlockingFunc(DWORD type) {
|
||||
return fo::funcoffs::obj_ai_blocking_at_;
|
||||
case BLOCKING_TYPE_SIGHT:
|
||||
return fo::funcoffs::obj_sight_blocking_at_;
|
||||
//case 4:
|
||||
//case 4:
|
||||
// return obj_scroll_blocking_at_;
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user