Skip to content

Commit

Permalink
Fix conditions contained in {brackets}
Browse files Browse the repository at this point in the history
Conditions that where sorrounded  by brackets (like is required in the conditional modifier) would sometimes not be correctly resolved. This should fix this.
  • Loading branch information
Jowan-Spooner committed Aug 30, 2024
1 parent 4eb5782 commit 1431779
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/dialogic/Modules/Core/subsystem_expression.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func execute_string(string:String, default: Variant = null, no_warning := false)
for res in regex.search_all(string):
var value: Variant = dialogic.VAR.get_variable(res.get_string())
string = string.replace(res.get_string(), var_to_str(value))

if string.begins_with("{") and string.ends_with('}') and string.count("{") == 1:
string = string.trim_prefix("{").trim_suffix("}")

var expr := Expression.new()

Expand Down

0 comments on commit 1431779

Please sign in to comment.