﻿fix_variable_error = {
  if = {
    limit = {has_variable = $X$ var:$X$ = flag:$X$ exists = scope:$X$ scope:$X$ = flag:$X$}
    set_variable = {name = $X$ value = flag:$X$} flag:$X$ = {save_scope_as = $X$}
  }
}