diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index 3d87bc5..37d3b19 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -5,6 +5,9 @@ #include "Contents/Actors/Npc.h" #include "Contents/Actors/Pc.h" #include "Contents/Sound/SoundMgr.h" +#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/CGameMode.h" +#include "Contents/World/WorldScene.h" #include "UI/Window/UIWindowMgr.h" #include "Resource/World/WorldResource.h" #include "Utility/Math/AffineMatrix.h" @@ -16,8 +19,7 @@ // OFFSET: 0x00DA1E30 // FUNCTION: fn_22363 -CSoundMaker::CSoundMaker(ResourceMgr& resources, JobNames& names, SoundMakerContext& context) - : CRenderObject(resources, names), m_context(&context) { +CSoundMaker::CSoundMaker(ResourceMgr& resources, JobNames& names) : CRenderObject(resources, names) { this->file.clear(); this->volume = 100.0f; this->range = 1.0f; @@ -45,6 +47,18 @@ CNpc::~CNpc() { // FUNCTION: fn_22365 CBlowEffect::~CBlowEffect() = default; +CBlurPC::~CBlurPC() = default; + +CHalluNPC::~CHalluNPC() = default; + +CHalluPC2::~CHalluPC2() = default; + +CHalluPC::~CHalluPC() = default; + +CHalluPlant::~CHalluPlant() = default; + +CSoundMaker::~CSoundMaker() = default; + // OFFSET: 0x00DA2450 // FUNCTION: fn_22367 CCorpse::~CCorpse() = default; @@ -87,7 +101,7 @@ bool CSoundMaker::Update() { return true; } - const CRenderObject* player = this->m_context->localPlayer; + const auto* player = reinterpret_cast(static_cast(g_world.ActiveGameMode())->scene->player); if (!player) { return true; } diff --git a/Source/Contents/Sound/SoundMaker.h b/Source/Contents/Sound/SoundMaker.h index 90f16a7..1b650fb 100644 --- a/Source/Contents/Sound/SoundMaker.h +++ b/Source/Contents/Sound/SoundMaker.h @@ -5,14 +5,10 @@ #include -struct SoundMakerContext { - CRenderObject* const& localPlayer; -}; - class CSoundMaker : public CRenderObject { public: - CSoundMaker(ResourceMgr& resources, JobNames& names, SoundMakerContext& context); - ~CSoundMaker() override = default; + CSoundMaker(ResourceMgr& resources, JobNames& names); + ~CSoundMaker() override; bool Update() override; void SendObjectMessage( CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m @@ -27,9 +23,6 @@ public: /* 0160 */ float radius; /* 0164 */ std::uint32_t lastTick; /* 0168 */ std::uint32_t cycle; - -private: - alignas(8) SoundMakerContext* m_context; }; #if defined(_WIN32) && !defined(_WIN64) @@ -41,7 +34,7 @@ static_assert(offsetof(CSoundMaker, range) == 0x15C); static_assert(offsetof(CSoundMaker, radius) == 0x160); static_assert(offsetof(CSoundMaker, lastTick) == 0x164); static_assert(offsetof(CSoundMaker, cycle) == 0x168); -static_assert(sizeof(CSoundMaker) == 0x178); +static_assert(sizeof(CSoundMaker) == 0x170); #endif #endif