Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Glas42 committed Feb 8, 2024
1 parent b692b39 commit 76a760c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/CruiseControl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def plugin(data):
hwnd_ats_multiplayer = ctypes.windll.user32.FindWindowW(None, "American Truck Simulator Multiplayer")
hwnd_active = ctypes.windll.user32.GetForegroundWindow()
if hwnd_active == hwnd_ets2 or hwnd_active == hwnd_ats or hwnd_active == hwnd_ets2_multiplayer or hwnd_active == hwnd_ats_multiplayer:
if map_topleft != None and map_bottomright != None and arrow_topleft != None and arrow_bottomright != None:
if map_topleft != None and map_bottomright != None and arrow_topleft != None and arrow_bottomright != None and map_topleft[0] < map_bottomright[0] and map_topleft[1] < map_bottomright[1] and arrow_topleft[0] < arrow_bottomright[0] and arrow_topleft[1] < arrow_bottomright[1]:
lower_blue = np.array([121, 68, 0])
upper_blue = np.array([250, 184, 109])
mask_blue = cv2.inRange(frame[arrow_topleft[1] - map_topleft[1]:arrow_bottomright[1] - map_bottomright[1], arrow_topleft[0] - map_topleft[0]:arrow_bottomright[0] - map_bottomright[0]], lower_blue, upper_blue)
Expand Down
4 changes: 2 additions & 2 deletions plugins/NavigationDetection/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def plugin(data):
check_map = False

if check_map == True:
if map_topleft != None and map_bottomright != None and arrow_topleft != None and arrow_bottomright != None:
if map_topleft != None and map_bottomright != None and arrow_topleft != None and arrow_bottomright != None and map_topleft[0] < map_bottomright[0] and map_topleft[1] < map_bottomright[1] and arrow_topleft[0] < arrow_bottomright[0] and arrow_topleft[1] < arrow_bottomright[1]:
lower_blue = np.array([121, 68, 0])
upper_blue = np.array([250, 184, 109])
mask_blue = cv2.inRange(frame[arrow_topleft[1] - map_topleft[1]:arrow_bottomright[1] - map_bottomright[1], arrow_topleft[0] - map_topleft[0]:arrow_bottomright[0] - map_bottomright[0]], lower_blue, upper_blue)
Expand Down Expand Up @@ -737,7 +737,7 @@ def GetArrayOfLaneEdges(y_coordinate_of_detection, tilt, x_offset, y_offset):
allow_do_zoom = True
show_turn_line = True

if map_topleft == None or map_bottomright == None or arrow_topleft == None or arrow_bottomright == None or arrow_percentage == None:
if map_topleft == None or map_bottomright == None or arrow_topleft == None or arrow_bottomright == None or arrow_percentage == None or map_topleft[0] > map_bottomright[0] or map_topleft[1] > map_bottomright[1] or arrow_topleft[0] > arrow_bottomright[0] or arrow_topleft[1] > arrow_bottomright[1]:
if allow_playsound == True:
sounds.PlaysoundFromLocalPath("assets/sounds/info.mp3")
allow_playsound = False
Expand Down

0 comments on commit 76a760c

Please sign in to comment.