Added Wads.ReadLump() to ZScript

https://forum.zdoom.org/viewtopic.php?t=57814
This commit is contained in:
alexey.lysiuk 2017-10-29 10:07:17 +02:00
parent 91fda180de
commit 2f45218f70
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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