mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Give context the ownership of repositories and the object manager (#7340)
This makes them no longer a singleton, which fixes annoying behaviour when launching multiple contexts in one game session.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "../Context.h"
|
||||
#include "../core/Math.hpp"
|
||||
#include "../core/Util.hpp"
|
||||
#include "../Game.h"
|
||||
@@ -167,7 +168,7 @@ void * object_entry_get_chunk(sint32 objectType, size_t index)
|
||||
}
|
||||
|
||||
void * result = nullptr;
|
||||
auto objectMgr = GetObjectManager();
|
||||
auto objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objectMgr->GetLoadedObject(objectIndex);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
@@ -179,7 +180,7 @@ void * object_entry_get_chunk(sint32 objectType, size_t index)
|
||||
const rct_object_entry * object_entry_get_entry(sint32 objectType, size_t index)
|
||||
{
|
||||
const rct_object_entry * result = nullptr;
|
||||
auto objectMgr = GetObjectManager();
|
||||
auto objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objectMgr->GetLoadedObject(objectType, index);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user