Skip to content

Commit

Permalink
EPA holograms: fixed duplicating timer events
Browse files Browse the repository at this point in the history
  • Loading branch information
phobos2077 committed May 2, 2024
1 parent 33ef266 commit 9bc32b7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions scripts_src/epa/epac4.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ variable Only_Once := 0;

procedure start
begin
add_timer_event(self_obj, game_ticks(random(4, 7)), 3);
end

procedure combat_p_proc
Expand Down Expand Up @@ -222,6 +221,9 @@ end
procedure map_enter_p_proc
begin
Only_Once := 0;
if (not is_loading_game) then begin
flush_add_timer_event_sec(self_obj, random(4, 7), 3);
end
end

procedure timed_event_p_proc
Expand All @@ -232,7 +234,7 @@ begin
if (((critter_state(self_obj) bwand 2) == 0) and not combat_is_initialized) then
begin
float_msg(self_obj, mstr(random(336, 345)), FLOAT_MSG_RED);
add_timer_event(self_obj, game_ticks(random(5, 7)), 3);
flush_add_timer_event_sec(self_obj, random(5, 7), 3);
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions scripts_src/epa/epac5.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ variable Only_Once := 0;

procedure start
begin
add_timer_event(self_obj, game_ticks(random(5, 8)), 3);
end

procedure combat_p_proc
Expand Down Expand Up @@ -205,6 +204,9 @@ end
procedure map_enter_p_proc
begin
Only_Once := 0;
if (not is_loading_game) then begin
flush_add_timer_event_sec(self_obj, random(5, 8), 3);
end
end

procedure timed_event_p_proc
Expand All @@ -214,7 +216,7 @@ begin
if (((critter_state(self_obj) bwand 2) == 0) and not combat_is_initialized) then
begin
float_msg(self_obj, mstr(random(244, 253)), FLOAT_MSG_YELLOW);
add_timer_event(self_obj, game_ticks(random(5, 6)), 3);
flush_add_timer_event_sec(self_obj, random(5, 6), 3);
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions scripts_src/epa/epac6.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ variable Only_Once := 0;

procedure start
begin
add_timer_event(self_obj, game_ticks(random(5, 8)), 3);
end

procedure combat_p_proc
Expand Down Expand Up @@ -218,6 +217,9 @@ end
procedure map_enter_p_proc
begin
Only_Once := 0;
if (not is_loading_game) then begin
flush_add_timer_event_sec(self_obj, random(5, 8), 3);
end
end

procedure timed_event_p_proc
Expand All @@ -227,7 +229,7 @@ begin
if (((critter_state(self_obj) bwand 2) == 0) and not combat_is_initialized) then
begin
float_msg(self_obj, mstr(random(333, 341)), FLOAT_MSG_GREEN);
add_timer_event(self_obj, game_ticks(random(5, 6)), 3);
flush_add_timer_event_sec(self_obj, random(5, 6), 3);
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions scripts_src/epa/epac7.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ variable Only_Once := 0;

procedure start
begin
add_timer_event(self_obj, game_ticks(random(5, 8)), 3);
end

procedure combat_p_proc
Expand Down Expand Up @@ -217,6 +216,9 @@ end
procedure map_enter_p_proc
begin
Only_Once := 0;
if (not is_loading_game) then begin
flush_add_timer_event_sec(self_obj, random(5, 8), 3);
end
end

procedure timed_event_p_proc
Expand All @@ -226,7 +228,7 @@ begin
if (((critter_state(self_obj) bwand 2) == 0) and not combat_is_initialized) then
begin
float_msg(self_obj, mstr(random(330, 336)), FLOAT_MSG_BLUE);
add_timer_event(self_obj, game_ticks(random(5, 6)), 3);
flush_add_timer_event_sec(self_obj, random(5, 6), 3);
end
end
end
Expand Down

0 comments on commit 9bc32b7

Please sign in to comment.