Skip to content

Commit

Permalink
Merge pull request #186 from Glas42/main
Browse files Browse the repository at this point in the history
small bugfixes
  • Loading branch information
Glas42 authored Feb 8, 2024
2 parents 235d152 + 76a760c commit 22389fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ plugins/Map/Old/VisualizeRoads/UNPACKTHISFILE.zip
plugins/Map/GameData/*.json
plugins/Map/Old
anomalousFrames
profiles/installer_config.cfg
plugins/TrafficLightDetection/YoloFiles
yolov5n.pt
yolov5s.pt
yolov5m.pt
yolov5l.pt
yolov5x.pt
plugins/NavigationDetection/YoloFiles
plugins/NavigationDetection/YOLOv5_MapDetectionModel.pt
# Wiki is built by github actions, no need to have users download it constantly
wiki/*

Expand Down
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 22389fa

Please sign in to comment.