Added a function to EngineUtils.cpp

Minor edits to ddraw.ini.
This commit is contained in:
NovaRain
2022-05-28 21:40:34 +08:00
parent 9667b522a8
commit a4230c3bad
4 changed files with 23 additions and 5 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
[Main]
;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash
;The required settings will be read from the f2_res.ini configuration file of the original hi-res patch
;This option is always read from the main ini file (i.e. ddraw.ini)
;This option is always read from the main ddraw.ini file
HiResMode=1
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
@@ -58,7 +58,7 @@ SpeedMultiInitial=100
;Set to 6 for DX9 fullscreen windowed (the resolution in f2_res.ini should be set to the same aspect ratio as your desktop resolution)
;A DX9 mode is required for any graphics related script extender functions to work (i.e. fullscreen shaders)
;Modes 1, 2 and 3 are no longer supported
;This option will always be read from the main ini file (i.e. ddraw.ini) when using the hi-res patch by Mash
;This option will always be read from the main ddraw.ini file when using the hi-res patch by Mash
Mode=0
;If using a DX9 mode, this changes the resolution
@@ -823,7 +823,7 @@ GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Debugging]
;Extra sfall configuration settings that can be used by modders
;This section is not affected by the 'UseCommandLine' option. It will always be read from the main ini file (i.e. ddraw.ini)
;This section is not affected by the 'UseCommandLine' option. It will always be read from the main ddraw.ini file
;Set to 1 to enable sfall debugging mode
Enable=0
+15
View File
@@ -214,6 +214,21 @@ fo::AttackSubType GetWeaponType(DWORD weaponFlag) {
return (type < 9) ? weapon_types[type] : fo::AttackSubType::NONE;
}
// Returns the distance a critter can move in combat based on current APs
long __fastcall GetCombatMoveDistance(fo::GameObject* critter, long freeMove) {
freeMove += critter->critter.movePoints;
long flags = critter->critter.damageFlags & (fo::DamageFlag::DAM_CRIP_LEG_LEFT | fo::DamageFlag::DAM_CRIP_LEG_RIGHT);
// both legs crippled (8 AP per hex)
if (flags == (fo::DamageFlag::DAM_CRIP_LEG_LEFT | fo::DamageFlag::DAM_CRIP_LEG_RIGHT)) return (freeMove / 8);
// not crippled
if (flags == 0) return freeMove;
// one leg crippled (4 AP per hex)
return (freeMove / 4);
}
long ObjIsOpenable(fo::GameObject* object) {
long result = 0;
if (fo::func::obj_is_openable(object)) {
+3
View File
@@ -101,6 +101,9 @@ long GetCurrentAttackMode();
fo::AttackSubType GetWeaponType(DWORD weaponFlag);
// Returns the distance a critter can move in combat based on current APs
long __fastcall GetCombatMoveDistance(fo::GameObject* critter, long freeMove);
long ObjIsOpenable(fo::GameObject* object);
bool HeroIsFemale();
+2 -2
View File
@@ -3151,7 +3151,7 @@ static long __fastcall CheckBarterAndBodyType(fo::GameObject* critter) {
!(proto->critter.critterFlags & fo::CritterFlags::Barter) && proto->critter.bodyType);
}
static void __declspec(naked) item_add_mult_hook_body_type() {
static void __declspec(naked) item_add_mult_hook() {
__asm {
push edx;
push ecx;
@@ -3998,7 +3998,7 @@ void BugFixes::init()
SafeWrite8(0x4B039F, 20); // text_object_create_ (was 19)
// Fix for being unable to plant items on non-biped critters with the "Barter" flag set (e.g. Skynet and Goris)
HookCall(0x477183, item_add_mult_hook_body_type);
HookCall(0x477183, item_add_mult_hook);
// Fix for being able to use the "Push" action on members of the player's team in combat when they are knocked down
HookCall(0x413718, action_can_be_pushed_hook);