diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 495a98db31..2c82138280 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -1290,6 +1290,14 @@ FMemLump FWadCollection::ReadLump (int lump) return FMemLump(FString(ELumpNum(lump))); } +DEFINE_ACTION_FUNCTION(_Wads, ReadLump) +{ + PARAM_PROLOGUE; + PARAM_INT(lump); + const bool isLumpValid = lump >= 0 && lump < Wads.GetNumLumps(); + ACTION_RETURN_STRING(isLumpValid ? Wads.ReadLump(lump).GetString() : FString()); +} + //========================================================================== // // OpenLumpNum diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 97a4d65a26..9c429fb4da 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -639,6 +639,7 @@ struct Wads native static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false); native static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace); + native static string ReadLump(int lump); } struct TerrainDef native