Skip to content

Commit

Permalink
Fixed map lighting from Night Vision perk
Browse files Browse the repository at this point in the history
* Before the perk effect only kicked in when map update proc ran after
game load. Now the delay is much shorter.
  • Loading branch information
NovaRain committed Jan 9, 2025
1 parent 686a332 commit 1224eaa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions sfall/FalloutEngine/FunctionOffsets_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,7 @@ FUNC(light_get_tile_true_, 0x47A9C4)
FUNC(light_increase_ambient_, 0x47A900)
FUNC(light_init_, 0x47A8F0)
FUNC(light_reset_tiles_, 0x47AA84)
FUNC(light_set_ambient_, 0x47A908)
FUNC(light_set_tile_, 0x47A9EC)
FUNC(light_subtract_from_tile_, 0x47AA48)
FUNC(lighten_buf_, 0x4D3A48)
Expand Down
1 change: 1 addition & 0 deletions sfall/FalloutEngine/Functions_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ WRAP_WATCOM_FUNC1(long, item_w_secondary_mp_cost, fo::GameObject*, item)
WRAP_WATCOM_FUNC2(long, item_w_subtype, fo::GameObject*, item, long, hitMode)
WRAP_WATCOM_FUNC1(long, item_weight, fo::GameObject*, item)
WRAP_WATCOM_FUNC2(long, light_get_tile, long, elevation, long, tileNum) // Returns light level at given tile
WRAP_WATCOM_FUNC2(void, light_set_ambient, long, intensity, long, isRefresh)
WRAP_WATCOM_FUNC2(long, load_frame, const char*, fileName, fo::FrmFile**, frmPtr)
WRAP_WATCOM_FUNC4(BYTE*, loadPCX, const char*, fileName, long*, width, long*, height, BYTE*, palette)
WRAP_WATCOM_FUNC1(fo::Program*, loadProgram, const char*, fileName)
Expand Down
2 changes: 2 additions & 0 deletions sfall/Modules/ScriptExtender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ static void InitGlobalScripts() {

HookScripts::InitHookScripts();
LoadGlobalScriptsList();
// Fix map lighting from Night Vision perk when loading a saved game
fo::func::light_set_ambient(fo::var::ambient_light, 1); // refresh map lighting

isGlobalScriptLoading = 0;
}
Expand Down

0 comments on commit 1224eaa

Please sign in to comment.