Skip to content

Commit 4d88e82

Browse files
prof-hastigmadame-rachelle
authored andcommitted
added Wads.GetLumpLength.
1 parent 77e5fd3 commit 4d88e82

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/common/scripting/interface/vmnatives.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,13 @@ DEFINE_ACTION_FUNCTION(_Wads, ReadLump)
848848
ACTION_RETURN_STRING(isLumpValid ? GetStringFromLump(lump, false) : FString());
849849
}
850850

851+
DEFINE_ACTION_FUNCTION(_Wads, GetLumpLength)
852+
{
853+
PARAM_PROLOGUE;
854+
PARAM_INT(lump);
855+
ACTION_RETURN_INT(fileSystem.FileLength(lump));
856+
}
857+
851858
//==========================================================================
852859
//
853860
// CVARs

wadsrc/static/zscript/engine/base.zs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ struct Wads // todo: make FileSystem an alias to 'Wads'
862862
native static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace);
863863
native static int FindLumpFullName(string name, int startlump = 0, bool noext = false);
864864
native static string ReadLump(int lump);
865+
native static int GetLumpLength(int lump);
865866

866867
native static int GetNumLumps();
867868
native static string GetLumpName(int lump);

0 commit comments

Comments
 (0)