mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Use toSomeType() instead of operator SomeType in ScriptValue.
This means that we are more explicit about type conversions. Also use override specifiers for overriden virtual functions in ScriptValue.
This commit is contained in:
@@ -44,7 +44,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
} else if (PackageChoiceValue* pvalue = dynamic_cast<PackageChoiceValue*>(value)) {
|
||||
pvalue->package_name = v->toString();
|
||||
} else if (ColorValue* cvalue = dynamic_cast<ColorValue*>(value)) {
|
||||
cvalue->value = v->operator Color();
|
||||
cvalue->value = v->toColor();
|
||||
} else {
|
||||
throw ScriptError(format_string(_("Can not set value '%s', it is not of the right type"),name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user