mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Added Wads.ReadLump() to ZScript
https://forum.zdoom.org/viewtopic.php?t=57814
This commit is contained in:
parent
91fda180de
commit
2f45218f70
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue