Skip to content

Commit

Permalink
Fixed trying to open a file like "map12002_backup2.txt" instead of "m…
Browse files Browse the repository at this point in the history
…ap12002.txt"
  • Loading branch information
rainlizard committed Mar 28, 2024
1 parent 361c87f commit 6f9709e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Scenes/OpenMap.gd
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func _on_FileDialogOpen_file_selected(path):

func get_accompanying_files(map):
var baseDir = map.get_base_dir()
var mapName = map.get_file()
var mapName = map.get_file().get_basename() # Get the map name without the extension

var dict = {}
var dir = Directory.new()
Expand All @@ -270,7 +270,8 @@ func get_accompanying_files(map):
var fileName = dir.get_next()
while fileName != "":
if dir.current_is_dir() == false:
if fileName.to_upper().begins_with(mapName.to_upper()): # Get file regardless of case (case insensitive)
var fileBaseName = fileName.get_basename() # Get the file name without the extension
if fileBaseName.to_upper() == mapName.to_upper():
var EXT = fileName.get_extension().to_upper()
if Filetypes.FILE_TYPES.has(EXT):
var fullPath = baseDir.plus_file(fileName)
Expand All @@ -284,6 +285,8 @@ func get_accompanying_files(map):





#file.seek(2+(3*( x + (y*85))))
# for x in 85:
# for y in 85:
Expand Down

0 comments on commit 6f9709e

Please sign in to comment.