Minor edits to code and document

This commit is contained in:
NovaRain
2021-01-31 00:48:04 +08:00
parent 0941b4684c
commit c27d1468ec
8 changed files with 17 additions and 16 deletions
+1 -2
View File
@@ -197,7 +197,7 @@ old:
end
> empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now it's always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition:
> **Does not work currently** empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now it's always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition:
#define my_macro diplay_msg("foo");
@@ -221,7 +221,6 @@ new:
callbackVar();
> *arrays: In vanilla fallout arrays had to be constructed by reserving a block of global/map variables. Since sfall 2.7, specific array targeted functions have been available, but they are fairly messy and long winded to use. The compiler provides additional syntactic shorthand for accessing and setting array variables, as well as for array creation. When declaring an array variable, put a constant integer in []'s to give the number of elements in the array. (before sfall 3.4 you had to specify size in bytes for array elements, now it's not required, see "arrays.txt" for more information)
new:
+1 -1
View File
@@ -3633,7 +3633,7 @@ void BugFixes::init()
MakeCall(0x49CBF7, check_door_state_hack_close, 2);
MakeCall(0x49CB30, check_door_state_hack_open, 1);
// Fix the "Leave" event procedure of the window region not being triggered when the cursor moves to a non-scripted window
// Fix for the "Leave" event procedure of the window region not being triggered when the cursor moves to a non-scripted window
MakeJump(0x4B6C3B, checkAllRegions_hack);
HookCall(0x4B6C13, checkAllRegions_hook);
}
+1 -1
View File
@@ -494,7 +494,7 @@ static void Combat_OnGameLoad() {
}
void Combat::init() {
CombatBlockedInit();
CombatBlock::init();
CombatProcFix();
MakeCall(0x424B76, compute_damage_hack, 2); // KnockbackMod
+1 -1
View File
@@ -738,7 +738,7 @@ void __declspec(naked) op_block_combat() {
mov esi, ecx;
_GET_ARG_INT(end);
push eax;
call SetBlockCombat;
call CombatBlock::SetBlockCombat;
end:
mov ecx, esi;
retn;
+2 -2
View File
@@ -60,11 +60,11 @@ end:
}
}
void __stdcall SetBlockCombat(long toggle) {
void __stdcall CombatBlock::SetBlockCombat(long toggle) {
combatDisabled = toggle != 0;
}
void CombatBlockedInit() {
void CombatBlock::init() {
HookCall(0x45F626, intface_use_item_hook); // jnz hook
HookCall(0x4432A6, game_handle_input_hook);
+5 -2
View File
@@ -21,8 +21,11 @@
namespace sfall
{
void CombatBlockedInit();
class CombatBlock {
public:
static void init();
void __stdcall SetBlockCombat(long toggle);
static void __stdcall SetBlockCombat(long toggle);
};
}
+1 -2
View File
@@ -26,8 +26,7 @@
namespace sfall
{
class OverlaySurface
{
class OverlaySurface {
private:
long size = 0;
long surfWidth;