Skip to content

Commit

Permalink
Expose ForceLightning() to ZScript.
Browse files Browse the repository at this point in the history
This makes it possible to call the function in ZScript without the Light_ForceLightning special.
  • Loading branch information
inkoalawetrust authored and coelckers committed Jan 5, 2024
1 parent 173407b commit ecdf6f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/playsim/mapthinkers/a_lightning.cpp
Expand Up @@ -36,6 +36,7 @@
#include "g_levellocals.h"
#include "events.h"
#include "gi.h"
#include <vm.h>

static FRandom pr_lightning ("Lightning");

Expand Down Expand Up @@ -297,3 +298,11 @@ void FLevelLocals::ForceLightning (int mode)
lightning->ForceLightning (mode);
}
}

DEFINE_ACTION_FUNCTION(FLevelLocals, ForceLightning)
{
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_INT(mode);
self->ForceLightning(mode);
return 0;
}
1 change: 1 addition & 0 deletions wadsrc/static/zscript/doombase.zs
Expand Up @@ -524,6 +524,7 @@ struct LevelLocals native
native String GetChecksum() const;

native void ChangeSky(TextureID sky1, TextureID sky2 );
native void ForceLightning(int mode = 0);

native SectorTagIterator CreateSectorTagIterator(int tag, line defline = null);
native LineIdIterator CreateLineIdIterator(int tag);
Expand Down

0 comments on commit ecdf6f7

Please sign in to comment.