Skip to content

Commit

Permalink
- exported unconditional level exit to ZScript
Browse files Browse the repository at this point in the history
Exit_Normal and Exit_Secret specials imply addition conditions to make a decision about proceeding to the next map
A few scriptified actors require a bypass of these conditions in order to work properly
  • Loading branch information
alexey-lysiuk committed Jun 17, 2019
1 parent 0972f03 commit 4f6ab52
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/g_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,12 +720,29 @@ void G_ExitLevel (int position, bool keepFacing)
G_ChangeLevel(G_GetExitMap(), position, keepFacing ? CHANGELEVEL_KEEPFACING : 0);
}

DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, ExitLevel, G_ExitLevel)
{
PARAM_PROLOGUE;
PARAM_INT(position);
PARAM_INT(keepFacing);
G_ExitLevel(position, keepFacing);
return 0;
}

void G_SecretExitLevel (int position)
{
level.flags3 |= LEVEL3_EXITSECRETUSED;
G_ChangeLevel(G_GetSecretExitMap(), position, 0);
}

DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, SecretExitLevel, G_SecretExitLevel)
{
PARAM_PROLOGUE;
PARAM_INT(position);
G_SecretExitLevel(position);
return 0;
}

//==========================================================================
//
//
Expand Down
3 changes: 3 additions & 0 deletions wadsrc/static/zscript/base.zs
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,9 @@ struct LevelLocals native
{
return Floor.CreateFloor(sec, floortype, ln, speed, height, crush, change, crushmode, hereticlower);
}

native static void ExitLevel(int position, bool keepFacing);
native static void SecretExitLevel(int position);
}

struct StringTable native
Expand Down

0 comments on commit 4f6ab52

Please sign in to comment.