Skip to content

Commit dbb801f

Browse files
committed
Fix extra "]" issue
1 parent a880310 commit dbb801f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

addons/uid_refresh/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="UID Refresh"
44
description="Quick way to refresh UIDs of your TSCN dependencies if the UID's become mismatched."
55
author="shout64"
6-
version="1.0.2"
6+
version="1.0.3"
77
script="uid_refresh.gd"

addons/uid_refresh/uid_refresh.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ func fix_broken_dependencies():
6161
var correct_asset_UID = ResourceUID.id_to_text(asset_UID_text)
6262

6363
# Open affected TSCN
64-
var tscn = FileAccess.open(affected_tscn, FileAccess.READ_WRITE)
64+
var tscn = FileAccess.open(affected_tscn, FileAccess.READ)
6565
var tscn_content_old = tscn.get_as_text()
66-
66+
tscn.close()
6767
# Fix the mismatched UID, and don't try to overwrite if it's already been fixed
6868
if tscn_content_old.contains(invalid_uid) == true:
6969
var tscn_content_new = tscn_content_old.replacen(invalid_uid, correct_asset_UID)
70+
tscn = FileAccess.open(affected_tscn, FileAccess.WRITE)
7071
tscn.store_string(tscn_content_new)
71-
print("Fixed broken UID for " + asset_path + " in the TSCN " + affected_tscn)
72+
tscn.close()
73+
print("Fixed broken UID in the TSCN " + affected_tscn + " for asset " + asset_path)
7274
else:
7375
print("First broken dependency is already fixed.")
7476
print("Run game to get a new copy of the error log.")
75-
return
76-
tscn.close()
7777

7878
log.close()
7979
else:

0 commit comments

Comments
 (0)