Skip to content

Commit 9869624

Browse files
committed
fixed array and formatting, added debug to run_speed
1 parent 18c7b96 commit 9869624

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

source/gl_g_run_speed.ssl

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ procedure set_run_fps(variable model, variable new_fps);
1616
procedure start begin
1717

1818
if game_loaded then begin
19+
variable fs_override := check_filesystem_override;
1920
enabled := fo2tweaks_setting(sec_main, set_run_speed);
20-
if enabled then begin
21+
if enabled and fs_override then begin
2122
variable frm, frms, fps, path;
2223
variable dude := fo2tweaks_setting(sec_run_speed, set_run_speed_dude);
2324
variable party := fo2tweaks_setting(sec_run_speed, set_run_speed_party);
@@ -48,30 +49,30 @@ procedure start begin
4849
end
4950

5051
frms := [ // hero appearance
51-
"hfr00s01\\art\\critters\\_hfjmps"
52-
"hfr00s01\\art\\critters\\_hflthr"
53-
"hfr00s01\\art\\critters\\_hfmaxx"
54-
"hfr00s01\\art\\critters\\_hfmetl"
55-
"hfr00s01\\art\\critters\\_hfprim"
56-
"hfr00s02\\art\\critters\\_hfjmps"
57-
"hfr00s02\\art\\critters\\_hflthr"
58-
"hfr00s02\\art\\critters\\_hfmaxx"
59-
"hfr00s02\\art\\critters\\_hfmetl"
60-
"hfr00s02\\art\\critters\\_hfprim"
61-
"hfr00s03\\art\\critters\\_hfjmps"
62-
"hfr00s03\\art\\critters\\_hflthr"
63-
"hfr00s03\\art\\critters\\_hfmaxx"
64-
"hfr00s03\\art\\critters\\_hfmetl"
65-
"hfr00s03\\art\\critters\\_hfprim"
66-
"hmr00s01\\art\\critters\\_hmjmps"
67-
"hmr00s01\\art\\critters\\_hmlthr"
68-
"hmr00s01\\art\\critters\\_hmmaxx"
69-
"hmr00s01\\art\\critters\\_hmmetl"
70-
"hmr00s01\\art\\critters\\_hmwarr"
71-
"hmr00s02\\art\\critters\\_hmjmps"
72-
"hmr00s02\\art\\critters\\_hmlthr"
73-
"hmr00s02\\art\\critters\\_hmmaxx"
74-
"hmr00s02\\art\\critters\\_hmmetl"
52+
"hfr00s01\\art\\critters\\_hfjmps",
53+
"hfr00s01\\art\\critters\\_hflthr",
54+
"hfr00s01\\art\\critters\\_hfmaxx",
55+
"hfr00s01\\art\\critters\\_hfmetl",
56+
"hfr00s01\\art\\critters\\_hfprim",
57+
"hfr00s02\\art\\critters\\_hfjmps",
58+
"hfr00s02\\art\\critters\\_hflthr",
59+
"hfr00s02\\art\\critters\\_hfmaxx",
60+
"hfr00s02\\art\\critters\\_hfmetl",
61+
"hfr00s02\\art\\critters\\_hfprim",
62+
"hfr00s03\\art\\critters\\_hfjmps",
63+
"hfr00s03\\art\\critters\\_hflthr",
64+
"hfr00s03\\art\\critters\\_hfmaxx",
65+
"hfr00s03\\art\\critters\\_hfmetl",
66+
"hfr00s03\\art\\critters\\_hfprim",
67+
"hmr00s01\\art\\critters\\_hmjmps",
68+
"hmr00s01\\art\\critters\\_hmlthr",
69+
"hmr00s01\\art\\critters\\_hmmaxx",
70+
"hmr00s01\\art\\critters\\_hmmetl",
71+
"hmr00s01\\art\\critters\\_hmwarr",
72+
"hmr00s02\\art\\critters\\_hmjmps",
73+
"hmr00s02\\art\\critters\\_hmlthr",
74+
"hmr00s02\\art\\critters\\_hmmaxx",
75+
"hmr00s02\\art\\critters\\_hmmetl",
7576
"hmr00s02\\art\\critters\\_hmwarr"
7677
];
7778
foreach frm in frms begin
@@ -96,7 +97,7 @@ procedure start begin
9697
"nmwarr", //sulik
9798
//new RP frms without AT anims
9899
"malieu", //marcus RP armor
99-
"laghul" //lenny RP new
100+
"laghul" //lenny RP new
100101
];
101102
foreach frm in frms begin
102103
path := "art\\critters\\" + frm;
@@ -116,10 +117,12 @@ procedure set_run_fps(variable path, variable new_fps) begin
116117
variable path_ab := path + "ab.frm";
117118
variable path_at := path + "at.frm";
118119
file := fs_copy(path_at, path_at);
119-
if not file then file := fs_copy(path_at, path_ab);
120-
if file then begin
121-
fs_seek(file, fps_offset);
122-
fs_write_short(file, new_fps);
123-
ndebug("set fps to " + new_fps + " in " + path_at);
120+
if file == -1 then file := fs_copy(path_at, path_ab);
121+
if file == -1 then begin
122+
ndebug("warning: couldn't find or create " + path_at);
123+
return;
124124
end
125+
fs_seek(file, fps_offset);
126+
fs_write_short(file, new_fps);
127+
ndebug("set fps to " + new_fps + " in " + path_at);
125128
end

source/headers/rp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../external/rp/scripts_src/HEADERS
1+
../../external/rp/scripts_src/headers

0 commit comments

Comments
 (0)