diff --git a/src/g_levellocals.h b/src/g_levellocals.h index 9fac6276e..cf63f81b2 100644 --- a/src/g_levellocals.h +++ b/src/g_levellocals.h @@ -194,7 +194,7 @@ public: AActor *SpawnMapThing(int index, FMapThing *mt, int position); AActor *SpawnPlayer(FPlayerStart *mthing, int playernum, int flags = 0); void StartLightning(); - void ForceLightning(int mode, const FString& tempSound = ""); + void ForceLightning(int mode, FSoundID tempSound = NO_SOUND); void ClearDynamic3DFloorData(); void WorldDone(void); void AirControlChanged(); diff --git a/src/playsim/mapthinkers/a_lightning.cpp b/src/playsim/mapthinkers/a_lightning.cpp index 0316d643f..f6e0f713d 100644 --- a/src/playsim/mapthinkers/a_lightning.cpp +++ b/src/playsim/mapthinkers/a_lightning.cpp @@ -48,7 +48,7 @@ IMPLEMENT_CLASS(DLightningThinker, false, false) // //---------------------------------------------------------------------------- -void DLightningThinker::Construct(const FString& tempSound) +void DLightningThinker::Construct(FSoundID tempSound) { Stopped = false; LightningFlashCount = 0; @@ -179,14 +179,14 @@ void DLightningThinker::LightningFlash () } Level->flags |= LEVEL_SWAPSKIES; // set alternate sky - if (TempLightningSound.IsEmpty()) + if (TempLightningSound == NO_SOUND) { S_Sound(CHAN_AUTO, 0, Level->LightningSound, 1.0, ATTN_NONE); } else { S_Sound(CHAN_AUTO, 0, TempLightningSound, 1.0, ATTN_NONE); - TempLightningSound = ""; + TempLightningSound = NO_SOUND; } // [ZZ] just in case Level->localEventManager->WorldLightning(); @@ -220,7 +220,7 @@ void DLightningThinker::LightningFlash () // //---------------------------------------------------------------------------- -void DLightningThinker::ForceLightning (int mode, const FString& tempSound) +void DLightningThinker::ForceLightning (int mode, FSoundID tempSound) { switch (mode) { @@ -298,7 +298,7 @@ void FLevelLocals::StartLightning () // //---------------------------------------------------------------------------- -void FLevelLocals::ForceLightning (int mode, const FString& tempSound) +void FLevelLocals::ForceLightning (int mode, FSoundID tempSound) { DLightningThinker *lightning = LocateLightning (this); if (lightning == nullptr) @@ -315,7 +315,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, ForceLightning) { PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); PARAM_INT(mode); - PARAM_STRING(tempSound); + PARAM_SOUND(tempSound); self->ForceLightning(mode,tempSound); return 0; } \ No newline at end of file diff --git a/src/playsim/mapthinkers/a_lightning.h b/src/playsim/mapthinkers/a_lightning.h index 502c76c64..f8f9b71df 100644 --- a/src/playsim/mapthinkers/a_lightning.h +++ b/src/playsim/mapthinkers/a_lightning.h @@ -6,17 +6,18 @@ #endif #include "dthinker.h" +#include "s_soundinternal.h" class DLightningThinker : public DThinker { DECLARE_CLASS (DLightningThinker, DThinker); public: static const int DEFAULT_STAT = STAT_LIGHTNING; - void Construct(const FString& tempSound = ""); + void Construct(FSoundID tempSound = NO_SOUND); ~DLightningThinker (); void Serialize(FSerializer &arc); void Tick (); - void ForceLightning (int mode, const FString& tempSound = ""); + void ForceLightning (int mode, FSoundID tempSound = NO_SOUND); void TerminateLightning(); protected: @@ -25,7 +26,7 @@ protected: int NextLightningFlash; int LightningFlashCount; bool Stopped; - FString TempLightningSound; + FSoundID TempLightningSound; TArray LightningLightLevels; }; diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 058b3a245..5a99de9e6 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -526,7 +526,7 @@ struct LevelLocals native native String GetChecksum() const; native void ChangeSky(TextureID sky1, TextureID sky2 ); - native void ForceLightning(int mode = 0, string tempSound = ""); + native void ForceLightning(int mode = 0, sound tempSound = ""); native SectorTagIterator CreateSectorTagIterator(int tag, line defline = null); native LineIdIterator CreateLineIdIterator(int tag);