Skip to content

Commit

Permalink
Exposed LevelLocals' LookupString functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Boondorl authored and coelckers committed Nov 11, 2022
1 parent aea346f commit fc7bb4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/scripting/vmthunks.cpp
Expand Up @@ -2450,6 +2450,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, SphericalCoords, SphericalCoords)
ACTION_RETURN_VEC3(result);
}

static void LookupString(FLevelLocals *level, uint32_t index, FString *res)
{
*res = level->Behaviors.LookupString(index);
}

DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, LookupString, LookupString)
{
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_UINT(index);
FString res;
LookupString(self, index, &res);
ACTION_RETURN_STRING(res);
}

static int isFrozen(FLevelLocals *self)
{
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/doombase.zs
Expand Up @@ -474,6 +474,7 @@ struct LevelLocals native
native vector3, int PickPlayerStart(int pnum, int flags = 0);
native int isFrozen() const;
native void setFrozen(bool on);
native string LookupString(uint index);

native clearscope Sector PointInSector(Vector2 pt) const;

Expand Down

0 comments on commit fc7bb4a

Please sign in to comment.