Skip to content

Commit bf7eb0b

Browse files
committed
Release 4.3.2
Minor changes.
1 parent dc1b7b8 commit bf7eb0b

12 files changed

Lines changed: 74 additions & 67 deletions

File tree

artifacts/ddraw.ini

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ UseCommandLine=0
99
;This file can be placed in text\<language>\ for sfall to get the translations depending on the game language
1010
;TranslationsINI=sfall\Translations.ini
1111

12+
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
13+
CreditsAtBottom=0
14+
1215
;Set this to a valid path to save a copy of the console contents
1316
;ConsoleOutputPath=console.txt
1417

@@ -29,8 +32,8 @@ UseCommandLine=0
2932

3033
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3134
[Speed]
32-
;Set to 0 to disable everything in this section
33-
Enable=1
35+
;Set to 1 to enable related options (SpeedMulti, SpeedModKey, SpeedToggleKey) to control the game speed adjustment
36+
Enable=0
3437

3538
;The speeds corresponding to each slot in percent. (i.e. 100 is normal speed)
3639
SpeedMulti0=50
@@ -704,12 +707,10 @@ KnockoutTime=35
704707
;Set to 1 to allow the player's character to automatically move towards the attack target if the distance exceeds the attack range when using a unarmed attack or melee weapons
705708
AutoMoveToAttack=0
706709

707-
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
708-
CreditsAtBottom=0
709-
710710
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
711-
; Critical engine fixes
711+
; Critical Modding options
712712
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
713+
;Change the following options with some caution if you are sure exactly what you are doing
713714

714715
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenery/critters
715716
;Set to 0 if another mod you're using has custom vehicles
@@ -742,7 +743,8 @@ AttackComplexFix=0
742743
;It is recommended to enable this option only when developing a new project
743744
CreateObjectSidFix=0
744745

745-
;Fixes the execution of the use_p_proc script procedure for containers of the grave type when they are in the open state
746+
;Set to 1 to fix the execution of the 'use_p_proc' script procedure for containers of the grave type when they are in the open state
747+
;By default, using open graves does not run the 'use_p_proc' procedure of attached script like other containers
746748
;It is recommended to enable this option only when developing a new project
747749
GraveContainersFix=0
748750

artifacts/ddraw_ru.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ UseCommandLine=0
99
;Этот файл может быть помещен в папку "data\text\<language>\" чтобы sfall брал локализованный текст в зависимости от выбранного языка игры.
1010
;TranslationsINI=sfall\Translations.ini
1111

12+
;Установите значение 1, чтобы поменять порядок титров. В начале титры игры, а затем титры sfall.
13+
CreditsAtBottom=0
14+
1215
;Укажите корректный путь для сохранения копии содержимого консоли
1316
;ConsoleOutputPath="bingle.txt"
1417

@@ -29,8 +32,8 @@ UseCommandLine=0
2932

3033
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3134
[Speed]
32-
;Установите значение 0, чтобы отключить данную секцию.
33-
Enable=1
35+
;Установите значение 1, чтобы включить опции SpeedMulti, SpeedModKey, и SpeedToggleKey для управления регулировкой скорости игры.
36+
Enable=0
3437

3538
;Скорость соответствующая каждому слоту в процентах. (т.е. 100 - стандартная скорость)
3639
SpeedMulti0=50
@@ -712,12 +715,10 @@ KnockoutTime=35
712715
;Установите значение 1, чтобы позволить персонажу игрока автоматически двигаться к цели атаки, если расстояние превышает дальность рукопашной атаки или оружия ближнего боя.
713716
AutoMoveToAttack=0
714717

715-
;Установите значение 1, чтобы поменять порядок титров. В начале титры игры, а затем титры sfall.
716-
CreditsAtBottom=0
717-
718718
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
719-
; Критические исправления движка
719+
; Критические опций моддинга
720720
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
721+
;Изменяйте следующие параметры с некоторой осторожностью, если вы точно уверены в том, что делаете.
721722

722723
;Установите значение 1, чтобы исправить ошибку в возможности заряжать автомобиль, используя ячейки(cells) на других объектах декорации или криттерах
723724
;Установите значение 0, если в моде имеется другой автотранспорт или используются собственные исправления (например Megamod).

artifacts/translations/chs.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ StyleText=
2222
DoneBtn=完成
2323

2424
;玩家空手攻击招式的自定名称(最长为16个字元,8个中文字)
25-
[Unarmed]
25+
[Hits]
2626
;Punch=拳击:
2727
;Kick=踢击:
2828
;StrongPunch=重拳:

artifacts/translations/cht.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ StyleText=
2222
DoneBtn=完成
2323

2424
;玩家空手攻擊招式的自定名稱(最長為16個字元,8個中文字)
25-
[Unarmed]
25+
[Hits]
2626
;Punch=拳擊:
2727
;Kick=踢擊:
2828
;StrongPunch=重拳:

sfall/IniReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static std::string getString(const char* section, const char* setting, const cha
3434

3535
static std::vector<std::string> getList(const char* section, const char* setting, const char* defaultValue, size_t bufSize, char delimiter, const char* iniFile) {
3636
auto list = split(getString(section, setting, defaultValue, bufSize, iniFile), delimiter);
37-
std::transform(list.cbegin(), list.cend(), list.begin(), trim);
37+
std::transform(list.cbegin(), list.cend(), list.begin(), (std::string (*)(const std::string&))trim);
3838
return list;
3939
}
4040

sfall/Modules/Animations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ void ApplyAnimationsAtOncePatches(signed char aniMax) {
595595
}
596596

597597
void Animations::init() {
598-
animationLimit = GetConfigInt("Misc", "AnimationsAtOnceLimit", sfall::animationLimit);
598+
animationLimit = IniReader::GetConfigInt("Misc", "AnimationsAtOnceLimit", sfall::animationLimit);
599599
if (animationLimit < 32) animationLimit = 32;
600600

601601
if (animationLimit > 32) {

sfall/Modules/Credits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void __declspec(naked) CreditsNextLineHook_Bottom() {
161161

162162
void Credits::init() {
163163
HookCalls(ShowCreditsHook, {0x480C49, 0x43F881});
164-
if (GetConfigInt("Misc", "CreditsAtBottom", 0)) {
164+
if (IniReader::GetConfigInt("Main", "CreditsAtBottom", 0)) {
165165
HookCall(0x42CB49, CreditsNextLineHook_Bottom);
166166
} else {
167167
HookCall(0x42CB49, CreditsNextLineHook_Top);

sfall/Modules/ScriptExtender.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ void __fastcall SetSelfObject(fo::Program* script, fo::GameObject* obj) {
431431

432432
// loads script from .int file into a sScriptProgram struct, filling script pointer and proc lookup table
433433
void InitScriptProgram(ScriptProgram &prog, const char* fileName, bool fullPath) {
434+
prog.initialized = false;
434435
fo::Program* scriptPtr = (fullPath)
435436
? fo::func::allocateProgram(fileName)
436437
: fo::func::loadProgram(fileName);
@@ -442,14 +443,13 @@ void InitScriptProgram(ScriptProgram &prog, const char* fileName, bool fullPath)
442443
for (int i = 0; i < fo::Scripts::ScriptProc::count; ++i) {
443444
prog.procLookup[i] = fo::func::interpretFindProcedure(prog.ptr, procTable[i]);
444445
}
445-
prog.initialized = false;
446446
} else {
447447
prog.ptr = nullptr;
448448
}
449449
}
450450

451451
void RunScriptProgram(ScriptProgram &prog) {
452-
if (!prog.initialized) {
452+
if (!prog.initialized && prog.ptr) {
453453
fo::func::runProgram(prog.ptr);
454454
fo::func::interpret(prog.ptr, -1);
455455
prog.initialized = true;
@@ -565,8 +565,8 @@ static void PrepareGlobalScriptsListByMask() {
565565
}
566566
}
567567
fo::func::db_free_file_list(&filenames, 0);
568-
globalScripts.reserve(globalScriptFilesList.size());
569568
}
569+
globalScripts.reserve(globalScriptFilesList.size());
570570
}
571571

572572
// this runs before the game was loaded/started

sfall/Modules/SpeedPatch.cpp

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ void TimerInit() {
176176
GetLocalTime(&time);
177177
SystemTimeToFileTime(&time, (FILETIME*)&startTime);
178178

179+
if (!modKey[0]) return;
180+
179181
speed = new SpeedCfg[10];
180182

181183
char buf[2], spKey[10] = "SpeedKey#";
@@ -189,45 +191,46 @@ void TimerInit() {
189191
}
190192

191193
void SpeedPatch::init() {
194+
int init = IniReader::GetConfigInt("Speed", "SpeedMultiInitial", 100);
195+
192196
if (IniReader::GetConfigInt("Speed", "Enable", 0)) {
193197
modKey[0] = IniReader::GetConfigInt("Input", "SpeedModKey", 0);
194-
int init = IniReader::GetConfigInt("Speed", "SpeedMultiInitial", 100);
195-
if (init == 100 && !modKey[0]) return;
196-
197-
dlog("Applying speed patch.", DL_INIT);
198-
199-
switch (modKey[0]) {
200-
case -1:
201-
modKey[0] = DIK_LCONTROL;
202-
modKey[1] = DIK_RCONTROL;
203-
break;
204-
case -2:
205-
modKey[0] = DIK_LMENU;
206-
modKey[1] = DIK_RMENU;
207-
break;
208-
case -3:
209-
modKey[0] = DIK_LSHIFT;
210-
modKey[1] = DIK_RSHIFT;
211-
break;
212-
default:
213-
modKey[1] = 0;
214-
}
215-
216-
multi = init / 100.0f;
217198
toggleKey = IniReader::GetConfigInt("Input", "SpeedToggleKey", 0);
199+
}
200+
if (init == 100 && !modKey[0]) return;
201+
202+
dlog("Applying speed patch.", DL_INIT);
203+
204+
switch (modKey[0]) {
205+
case -1:
206+
modKey[0] = DIK_LCONTROL;
207+
modKey[1] = DIK_RCONTROL;
208+
break;
209+
case -2:
210+
modKey[0] = DIK_LMENU;
211+
modKey[1] = DIK_RMENU;
212+
break;
213+
case -3:
214+
modKey[0] = DIK_LSHIFT;
215+
modKey[1] = DIK_RSHIFT;
216+
break;
217+
default:
218+
modKey[1] = 0;
219+
}
218220

219-
getTickCountOffs = (DWORD)&FakeGetTickCount;
220-
getLocalTimeOffs = (DWORD)&FakeGetLocalTime;
221+
multi = init / 100.0f;
221222

222-
for (int i = 0; i < sizeof(offsets) / 4; i++) {
223-
SafeWrite32(offsets[i], (DWORD)&getTickCountOffs);
224-
}
225-
SafeWrite32(0x4FDF58, (DWORD)&getLocalTimeOffs);
226-
HookCall(0x4A433E, scripts_check_state_hook);
223+
getTickCountOffs = (DWORD)&FakeGetTickCount;
224+
getLocalTimeOffs = (DWORD)&FakeGetLocalTime;
227225

228-
TimerInit();
229-
dlogr(" Done", DL_INIT);
226+
for (int i = 0; i < sizeof(offsets) / 4; i++) {
227+
SafeWrite32(offsets[i], (DWORD)&getTickCountOffs);
230228
}
229+
SafeWrite32(0x4FDF58, (DWORD)&getLocalTimeOffs);
230+
HookCall(0x4A433E, scripts_check_state_hook);
231+
232+
TimerInit();
233+
dlogr(" Done", DL_INIT);
231234
}
232235

233236
void SpeedPatch::exit() {

sfall/SafeWrite.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ static __declspec(noinline) void __stdcall SafeWriteFunc(uint8_t code, uint32_t
2424
*((BYTE*)addr) = code;
2525
*((DWORD*)(addr + 1)) = data;
2626

27-
for (size_t i = 0; i < len; i++) {
28-
*((BYTE*)(addrMem + i)) = CodeType::Nop;
29-
}
27+
do {
28+
*(BYTE*)addrMem++ = CodeType::Nop;
29+
} while (--len);
30+
3031
VirtualProtect((void*)addr, protectLen, oldProtect, &oldProtect);
3132

3233
CheckConflict(addr, protectLen);

0 commit comments

Comments
 (0)