mirror of https://github.com/OpenRCT2/OpenRCT2.git
Return null for legacyIdentifier
This commit is contained in:
parent
ffe5f74fa3
commit
0ed4bfbc4a
|
@ -1658,7 +1658,7 @@ declare global {
|
|||
* This may have trailing spaces if the name is shorter than 8 characters.
|
||||
* Only .DAT objects or JSON objects based on .DAT objects will have legacy identifiers.
|
||||
*/
|
||||
readonly legacyIdentifier: string;
|
||||
readonly legacyIdentifier: string | null;
|
||||
|
||||
/**
|
||||
* The object version, e.g. "1.5.2-pre".
|
||||
|
|
|
@ -145,17 +145,18 @@ namespace OpenRCT2::Scripting
|
|||
return {};
|
||||
}
|
||||
|
||||
std::string legacyIdentifier_get() const
|
||||
DukValue legacyIdentifier_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
auto installedObject = GetInstalledObject();
|
||||
if (installedObject != nullptr)
|
||||
{
|
||||
if (!installedObject->ObjectEntry.IsEmpty())
|
||||
{
|
||||
return std::string(installedObject->ObjectEntry.GetName());
|
||||
return ToDuk(ctx, installedObject->ObjectEntry.GetName());
|
||||
}
|
||||
}
|
||||
return {};
|
||||
return ToDuk(ctx, nullptr);
|
||||
}
|
||||
|
||||
std::vector<std::string> authors_get() const
|
||||
|
|
Loading…
Reference in New Issue