private void ValidateVariableType(string reference, NWN2WaypointTemplate waypoint, string variable, NWN2ScriptVariableType type, bool enforce = true)
{
if (waypoint == null) return;
if (waypoint.Variables.GetVariable(variable) == null) return;
if (waypoint.Variables.GetVariable(variable).VariableType != type)
{
if (enforce)
{
waypoint.Variables.GetVariable(variable).VariableType = type;
log.WriteLine("FIXED: Waypoint blueprint \"{0}\" has variable \"{1}\" not of type {2}.", reference, variable, type.ToString());
}
else
{
log.WriteLine("ERROR: Waypoint blueprint \"{0}\" has variable \"{1}\" not of type {2}.", reference, variable, type.ToString());
}
}
}