Skip to content

Commit

Permalink
AllowUnsafeScripting 2 -> 1
Browse files Browse the repository at this point in the history
- mode 1 forced, mode 2+ accepted (for old installs)
- removed VOODOO_Init() call
  without lookup table stuff, patches using VOODOO_Alloc() shouldn't be used anymore
- deprecated VOOOO_close_game
  • Loading branch information
wipe2238 committed Jun 23, 2024
1 parent 2b40388 commit d706e04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
21 changes: 7 additions & 14 deletions Fallout2/Fallout1in2/Mapper/source/scripts/GlobalScripts/gl_0.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ procedure start begin

debug("Remember to wear protective goggles" + _ANSI_window_name("Fallout 1in2 Debug Console"));

if (get_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting") != 2) then begin
if (get_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting") < 1) then begin
call error_AllowUnsafeScripting in 1;
end else begin
if (get_ini_setting("ddraw.ini|Misc|DisableHorrigan") == 0) then begin
Expand All @@ -36,19 +36,12 @@ procedure start begin
if (get_ini_setting("ddraw.ini|Misc|Fallout1Behavior") == 0) then begin
call error_Fallout1Behavior in 1;
end

init := VOODOO_Init(); // must be called before any other voodoo magick

//if(init) then
//begin
// everything in this block will run only once per session
//end
end
end

procedure error_AllowUnsafeScripting begin
debug_warning("Fo1in2 SETTINGS - 'AllowUnsafeScripting' != 2 in ddraw.ini!");
message_box_warning("ERROR\n\nInvalid 'AllowUnsafeScripting' value\nChange ddraw.ini setting to 2!");
debug_warning("Fo1in2 SETTINGS - 'AllowUnsafeScripting' < 1 in ddraw.ini!");
message_box_warning("ERROR\n\nInvalid 'AllowUnsafeScripting' value\nChange ddraw.ini setting to 1!");
//create_message_window("Warning:\n'AllowUnsafeScripting' disabled in ddraw.ini\nFallout et Tu will not work correctly!");

call force_settings;
Expand Down Expand Up @@ -80,10 +73,10 @@ procedure force_settings begin
set_ini_setting("ddraw.ini|Misc|UseFileSystemOverride", 1);
set_ini_setting("ddraw.ini|Misc|Fallout1Behavior", 1);

if (metarule_exist("signal_close_game")) then begin
set_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting", 2);
set_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting", 1);
if (metarule_exist("signal_close_game"))
signal_close_game;
end else begin
VOODOO_close_game;
else
variable bad_cfg:= read_byte(0xBADCF6);
end
end
2 changes: 2 additions & 0 deletions Fallout2/Fallout1in2/Mapper/source/scripts/headers/voodoo.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ variable $addr;
write_byte(0x4A2A0D, 75)

// This will shut down the game and not just send the player back to the main menu
/*
#define VOODOO_close_game \
write_byte(0x481B2A, 0xB8); /* mov eax, 27 (ESC key input) */ \
write_int(0x481B2B, 27); \
signal_end_game
*/

/////////////////////////////////////////////////// AUTOMAGICK ZONE ///////////////////////////////////////////////////
//
Expand Down
2 changes: 1 addition & 1 deletion Fallout2/Fallout1in2/ddraw.fo1in2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ GlobalScriptPaths=scripts\gl_*.int,scripts\sfall\gl*.int
Enable=1
ConsoleWindow=0

AllowUnsafeScripting=2
AllowUnsafeScripting=1

DebugMode=0

Expand Down

0 comments on commit d706e04

Please sign in to comment.