Skip to content

Commit

Permalink
fix: 🐛 fixed assert calls (#343)
Browse files Browse the repository at this point in the history
Assert calls got messed up during the conversion, removed the added comment.
  • Loading branch information
KANAjetzt authored Oct 8, 2023
1 parent b4633f7 commit e3e795b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addons/mod_loader/api/log.gd
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static func _log(message: String, mod_name: String, log_type: String = "info", o
push_error(message)
_write_to_log_file(log_entry.get_entry())
_write_to_log_file(JSON.stringify(get_stack(), " "))
# assert(false) #,message)
assert(false, message)
"error":
printerr(message)
push_error(message)
Expand Down Expand Up @@ -475,7 +475,7 @@ static func _write_to_log_file(string_to_write: String) -> void:
var log_file := FileAccess.open(MOD_LOG_PATH, FileAccess.READ_WRITE)

if log_file == null:
assert(false) #,"Could not open log file, error code: %s" % error)
assert(false, "Could not open log file, error code: %s" % error)
return

log_file.seek_end()
Expand Down Expand Up @@ -503,7 +503,7 @@ static func _rotate_log_file() -> void:
# only File.WRITE creates a new file, File.READ_WRITE throws an error
var log_file := FileAccess.open(MOD_LOG_PATH, FileAccess.WRITE)
if log_file == null:
assert(false) #,"Could not open log file, error code: %s" % error)
assert(false, "Could not open log file, error code: %s" % error)
log_file.store_string('%s Created log' % _get_date_string())
log_file.close()

Expand Down
4 changes: 2 additions & 2 deletions addons/mod_loader/internal/godot.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static func check_autoload_order(autoload_name_before: String, autoload_name_aft
push_error(final_message)
ModLoaderLog._write_to_log_file(final_message)
ModLoaderLog._write_to_log_file(JSON.stringify(get_stack(), " "))
assert(false) #,final_message)
assert(false, final_message)

return false

Expand All @@ -55,7 +55,7 @@ static func check_autoload_position(autoload_name: String, position_index: int,
push_error(final_message)
ModLoaderLog._write_to_log_file(final_message)
ModLoaderLog._write_to_log_file(JSON.stringify(get_stack(), " "))
assert(false) #,final_message)
assert(false, final_message)

return position_matches

Expand Down
6 changes: 3 additions & 3 deletions addons/mod_loader/setup/setup_log.gd
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static func _log(message: String, mod_name: String, log_type: String = "info") -
push_error(message)
_write_to_log_file(log_entry.get_entry())
_write_to_log_file(JSON.stringify(get_stack(), " "))
assert(false) #,message)
assert(false, message)
"error":
printerr(message)
push_error(message)
Expand Down Expand Up @@ -147,7 +147,7 @@ static func _write_to_log_file(string_to_write: String) -> void:
var log_file := FileAccess.open(MOD_LOG_PATH, FileAccess.READ_WRITE)

if log_file == null:
assert(false) #,"Could not open log file, error code: %s" % error)
assert(false, "Could not open log file, error code: %s" % error)
return

log_file.seek_end()
Expand Down Expand Up @@ -175,7 +175,7 @@ static func _rotate_log_file() -> void:
# only File.WRITE creates a new file, File.READ_WRITE throws an error
var log_file := FileAccess.open(MOD_LOG_PATH, FileAccess.WRITE)
if log_file == null:
assert(false) #,"Could not open log file, error code: %s" % error)
assert(false, "Could not open log file, error code: %s" % error)
log_file.store_string('%s Created log' % _get_date_string())
log_file.close()

Expand Down

0 comments on commit e3e795b

Please sign in to comment.