diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index e436f979..99ea32f2 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -54,7 +54,6 @@ #include "Utility/Math/AffineMatrix.h" #include "Utility/Cipher/XorBytes.h" #include "Utility/Math/ScalarConversion.h" -#include "Contents/World/WorldObjects.h" #include "Contents/ChampionMonsterMgr.h" #include "Contents/Effects/EffectPrim.h" #include "Contents/Ground/TerrainHeight.h" @@ -4821,7 +4820,7 @@ void CGameActor::SpawnDamageDigits(int, int damage, std::uint32_t color, int typ this->ClearUnknown037C(reinterpret_cast(effect)); effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); it = this->unknown_03B0.erase(it); - reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene)->Remove(effect); + static_cast(g_modeMgr.GetGameMode())->scene->RemoveObject(effect); } else { ++it; } diff --git a/Source/Contents/Actors/Skill.cpp b/Source/Contents/Actors/Skill.cpp index ad55d220..63e815d7 100644 --- a/Source/Contents/Actors/Skill.cpp +++ b/Source/Contents/Actors/Skill.cpp @@ -20,7 +20,6 @@ #include "Contents/World/World.h" #include "Resource/Models/ModelResource.h" #include "Resource/ResourceMgr.h" -#include "Contents/World/WorldObjects.h" #include "Render/Renderer.h" #include "Render/SpriteGeometry.h" #include "Resource/World/TerrainResource.h" @@ -97,7 +96,7 @@ CSkill::~CSkill() { this->ReleaseModel(); for (std::uint64_t target : this->m_targets) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - reinterpret_cast(mode->scene)->SendObjectMessage(this, target, 24, 0, 0, 0, 0); + mode->scene->SendObjectMessage(this, target, 24, 0, 0, 0, 0); } this->m_targets.clear(); diff --git a/Source/Contents/Effects/AcidifiedThrow.cpp b/Source/Contents/Effects/AcidifiedThrow.cpp index e77fcec0..7fe76dbb 100644 --- a/Source/Contents/Effects/AcidifiedThrow.cpp +++ b/Source/Contents/Effects/AcidifiedThrow.cpp @@ -9,7 +9,6 @@ #include "Contents/Effects/Particle.h" #include "Contents/Sound/SoundMgr.h" #include "Contents/World/World.h" -#include "Contents/World/WorldObjects.h" #include "Utility/Math/AffineMatrix.h" #include diff --git a/Source/Contents/World/World.h b/Source/Contents/World/World.h index 80380e56..39f32d02 100644 --- a/Source/Contents/World/World.h +++ b/Source/Contents/World/World.h @@ -13,6 +13,7 @@ class BinkMovies; class CItem; class CGameMode; +class CGameObject; class CPlayer; class CRenderObject; class GroundGeometry; @@ -53,6 +54,8 @@ public: void AddPcPosFromCell(std::uint32_t aid, const int* cell); void AddPcPosUnindexed(std::uint32_t aid, const CellFloatPos& cell); void InitWorld(); + void RemoveObject(CRenderObject* object); + void SendObjectMessage(CGameObject* sender, std::uint64_t identity, int message, int a, int b, int c, int d); static unsigned long __stdcall LoadDeferredModels(void* parameter); void FinishModelLoading(); diff --git a/Source/Contents/World/WorldObjects.cpp b/Source/Contents/World/WorldObjects.cpp index d87dd1ae..7f6b2386 100644 --- a/Source/Contents/World/WorldObjects.cpp +++ b/Source/Contents/World/WorldObjects.cpp @@ -7,7 +7,6 @@ #include "Contents/Actors/Item.h" #include "Contents/Actors/GameActor.h" #include "Client/Mode/ModeMgr.h" -#include "Contents/World/WorldObjects.h" #include "Contents/World/World.h" #include "Contents/Effects/ArrowEffect.h" #include "Contents/Effects/EffectLists.h" @@ -75,7 +74,7 @@ CRenderObject* CWorld::GetGameActorByAidIncludeMe(std::uint32_t aid) const { // OFFSET: 0x00ACA4E0 // FUNCTION: fn_17692 -void WorldObjects::Remove(CRenderObject* object) { +void CWorld::RemoveObject(CRenderObject* object) { for (auto entry = this->objects.begin(); entry != this->objects.end(); ++entry) { if (*entry == object) { delete object; @@ -259,7 +258,7 @@ void CWorld::Clear() { // OFFSET: 0x00ACA980 // FUNCTION: fn_17698 -void WorldObjects::SendObjectMessage(CGameObject* sender, std::uint64_t identity, int message, int a, int b, int c, int d) { +void CWorld::SendObjectMessage(CGameObject* sender, std::uint64_t identity, int message, int a, int b, int c, int d) { if (this == nullptr) { return; } @@ -922,7 +921,7 @@ bool CWorld::RemoveSkill(std::uint32_t aid) { return false; } - reinterpret_cast(this)->Remove(skill); + this->RemoveObject(skill); this->unknown_0020.erase(entry); return true; } diff --git a/Source/Contents/World/WorldObjects.h b/Source/Contents/World/WorldObjects.h deleted file mode 100644 index 6a90e91a..00000000 --- a/Source/Contents/World/WorldObjects.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDOBJECTS_H -#define RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDOBJECTS_H - -#include -#include - -class CGameObject; -class CRenderObject; - -struct WorldObjects { - std::list& objects; - - void Remove(CRenderObject* object); - void SendObjectMessage(CGameObject* sender, std::uint64_t identity, int message, int a, int b, int c, int d); -}; - -#endif