Expose ForceLightning() to ZScript.

This makes it possible to call the function in ZScript without the Light_ForceLightning special.
This commit is contained in:
inkoalawetrust 2023-01-28 01:10:23 +02:00 committed by Christoph Oelckers
parent 173407bf48
commit ecdf6f7cb2
2 changed files with 10 additions and 0 deletions

View file

@ -36,6 +36,7 @@
#include "g_levellocals.h"
#include "events.h"
#include "gi.h"
#include <vm.h>
static FRandom pr_lightning ("Lightning");
@ -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;
}

View file

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