Skip to content

Commit

Permalink
Export FindLumpFullName to ZScript.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa the Magician authored and coelckers committed Aug 5, 2022
1 parent 4c6d0e4 commit 931211b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/common/scripting/interface/vmnatives.cpp
Expand Up @@ -758,6 +758,16 @@ DEFINE_ACTION_FUNCTION(_Wads, FindLump)
ACTION_RETURN_INT(isLumpValid ? fileSystem.FindLump(name, &startlump, 0 != ns) : -1);
}

DEFINE_ACTION_FUNCTION(_Wads, FindLumpFullName)
{
PARAM_PROLOGUE;
PARAM_STRING(name);
PARAM_INT(startlump);
PARAM_BOOL(noext);
const bool isLumpValid = startlump >= 0 && startlump < fileSystem.GetNumEntries();
ACTION_RETURN_INT(isLumpValid ? fileSystem.FindLumpFullName(name, &startlump, noext) : -1);
}

DEFINE_ACTION_FUNCTION(_Wads, GetLumpName)
{
PARAM_PROLOGUE;
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/engine/base.zs
Expand Up @@ -829,6 +829,7 @@ struct Wads // todo: make FileSystem an alias to 'Wads'
native static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false);
native static int CheckNumForFullName(string name);
native static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace);
native static int FindLumpFullName(string name, int startlump = 0, bool noext = false);
native static string ReadLump(int lump);

native static int GetNumLumps();
Expand Down

0 comments on commit 931211b

Please sign in to comment.