mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
Implemented WorldLightning and WorldThingDestroyed.
This commit is contained in:
parent
71f62af6db
commit
3c1cecfa2b
2 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "r_state.h"
|
#include "r_state.h"
|
||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
#include "g_levellocals.h"
|
#include "g_levellocals.h"
|
||||||
|
#include "events.h"
|
||||||
|
|
||||||
static FRandom pr_lightning ("Lightning");
|
static FRandom pr_lightning ("Lightning");
|
||||||
|
|
||||||
|
@ -129,6 +130,9 @@ void DLightningThinker::LightningFlash ()
|
||||||
|
|
||||||
level.flags |= LEVEL_SWAPSKIES; // set alternate sky
|
level.flags |= LEVEL_SWAPSKIES; // set alternate sky
|
||||||
S_Sound (CHAN_AUTO, "world/thunder", 1.0, ATTN_NONE);
|
S_Sound (CHAN_AUTO, "world/thunder", 1.0, ATTN_NONE);
|
||||||
|
// [ZZ] just in case
|
||||||
|
E_WorldLightning();
|
||||||
|
// start LIGHTNING scripts
|
||||||
FBehavior::StaticStartTypedScripts (SCRIPT_Lightning, NULL, false); // [RH] Run lightning scripts
|
FBehavior::StaticStartTypedScripts (SCRIPT_Lightning, NULL, false); // [RH] Run lightning scripts
|
||||||
|
|
||||||
// Calculate the next lighting flash
|
// Calculate the next lighting flash
|
||||||
|
|
|
@ -5108,6 +5108,12 @@ void AActor::CallDeactivate(AActor *activator)
|
||||||
|
|
||||||
void AActor::OnDestroy ()
|
void AActor::OnDestroy ()
|
||||||
{
|
{
|
||||||
|
// [ZZ] call destroy event hook.
|
||||||
|
// note that this differs from ThingSpawned in that you can actually override OnDestroy to avoid calling the hook.
|
||||||
|
// but you can't really do that without utterly breaking the game, so it's ok.
|
||||||
|
// note: if OnDestroy is ever made optional, E_WorldThingDestroyed should still be called for ANY thing.
|
||||||
|
E_WorldThingDestroyed(this);
|
||||||
|
|
||||||
ClearRenderSectorList();
|
ClearRenderSectorList();
|
||||||
ClearRenderLineList();
|
ClearRenderLineList();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue