Skip to content

Commit

Permalink
Fix wcsecbot.int spam - ERROR: attempt to reference map var out of ra…
Browse files Browse the repository at this point in the history
…nge: 133. Ref #296
  • Loading branch information
burner1024 committed Jun 15, 2024
1 parent 3e77079 commit 8a4520f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions scripts_src/headers/depolvz.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,21 @@ end

#define dude_in_sierra ((cur_map_index == MAP_SIERRA_123) or (cur_map_index == MAP_SIERRA_4))

#define sierra_cur_level_sec_on \
( ( (cur_map_index == MAP_SIERRA_123) \
and ( \
((self_elevation == LEVEL_ONE) and (map_var(MVAR_Security_Level_1) == 1)) \
or ((self_elevation == LEVEL_TWO) and (map_var(MVAR_Security_Level_2) == 1)) \
or ((self_elevation == LEVEL_THREE) and (map_var(MVAR_Security_Level_3) == 1)) \
) \
) \
or ((cur_map_index == MAP_SIERRA_4) and (map_var(MVAR_Security_Level_4) == 1)) \
)
/**
* Returns `true` if in Sierra and current level alerts is on, `false` otherwise.
* @ret {bool}
*/
procedure sierra_cur_level_sec_on begin
if cur_map_index == MAP_SIERRA_123 then begin
if (self_elevation == LEVEL_ONE and map_var(MVAR_Security_Level_1) == 1)
or (self_elevation == LEVEL_TWO and map_var(MVAR_Security_Level_2) == 1)
or (self_elevation == LEVEL_THREE and map_var(MVAR_Security_Level_3) == 1)
then return true;
end else if cur_map_index == MAP_SIERRA_4 then begin
if map_var(MVAR_Security_Level_4) == 1 then return true;
end
return false;
end

#define sierra_set_cur_level_sec_on \
if dude_in_sierra then begin \
Expand Down

0 comments on commit 8a4520f

Please sign in to comment.