Skip to content

Commit

Permalink
fix(zscript): handle engine subscreen in ScriptTypeToString
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed May 6, 2024
1 parent 1ec3f92 commit 19edaac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/base/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ enum class ScriptType {
Generic,
GenericFrozen,
EngineSubscreen,
// Update the following when adding a new script type:
// - const char* ScriptTypeToString(ScriptType type)
// - string get_script_name(ScriptType type)
// - ScriptType get_script_type(string const& name)
First = Global,
Last = EngineSubscreen,
};
Expand Down
7 changes: 2 additions & 5 deletions src/base/zdefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,16 +1368,13 @@ savedportal::savedportal()
uid = nextuid++;
}

// NOTE: there is also:
// string get_script_name(ScriptType type)
// ScriptType get_script_type(string const& name)
const char* ScriptTypeToString(ScriptType type)
{
static const char script_types[][16] =
static const char script_types[][19] =
{
"none", "global", "ffc", "screendata", "hero", "item", "lweapon", "npc", "subscreen",
"eweapon", "dmapdata", "itemsprite", "dmapdata (AS)", "dmapdata (PS)", "combodata", "dmapdata (MAP)",
"generic", "generic (FRZ)"
"generic", "generic (FRZ)", "subscreen (engine)"
};
return script_types[(int)type];
}

0 comments on commit 19edaac

Please sign in to comment.