Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Client/game_sa/C3DMarkersSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,15 @@ C3DMarker* C3DMarkersSA::FindMarker(DWORD Identifier)
}
return NULL;
}

void C3DMarkersSA::ReinitMarkers()
{
using Function_ShutdownMarkers = void(__cdecl *)();
auto shutdownMarkers = reinterpret_cast<Function_ShutdownMarkers>(0x722710);

using Function_InitMarkers = void(__cdecl*)();
auto initMarkers = reinterpret_cast<Function_InitMarkers>(0x724E40);

shutdownMarkers();
initMarkers();
}
1 change: 1 addition & 0 deletions Client/game_sa/C3DMarkersSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ class C3DMarkersSA : public C3DMarkers
C3DMarker* CreateMarker(DWORD Identifier, e3DMarkerType dwType, CVector* vecPosition, float fSize, float fPulseFraction, BYTE r, BYTE g, BYTE b, BYTE a);
C3DMarker* FindFreeMarker();
C3DMarker* FindMarker(DWORD Identifier);
void ReinitMarkers();
};
7 changes: 7 additions & 0 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5425,6 +5425,8 @@ void CClientGame::ResetMapInfo()
pPlayerInfo->SetCamDrunkLevel(static_cast<byte>(0));

RestreamWorld(true);

ReinitMarkers();
}

void CClientGame::SendPedWastedPacket(CClientPed* Ped, ElementID damagerID, unsigned char ucWeapon, unsigned char ucBodyPiece, AssocGroupId animGroup,
Expand Down Expand Up @@ -6565,6 +6567,11 @@ void CClientGame::RestreamWorld(bool removeBigBuildings)
g_pGame->GetStreaming()->ReinitStreaming();
}

void CClientGame::ReinitMarkers()
{
g_pGame->Get3DMarkers()->ReinitMarkers();
}

void CClientGame::OnWindowFocusChange(bool state)
{
if (state == m_bFocused)
Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CClientGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ class CClientGame
bool TriggerBrowserRequestResultEvent(const std::unordered_set<SString>& newPages);
void RestreamModel(unsigned short usModel);
void RestreamWorld(bool removeBigBuildings);
void ReinitMarkers();

void OnWindowFocusChange(bool state);

Expand Down
6 changes: 6 additions & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void CLuaEngineDefs::LoadFunctions()
{"engineGetModelTXDID", ArgumentParser<EngineGetModelTXDID>},
{"engineStreamingFreeUpMemory", ArgumentParser<EngineStreamingFreeUpMemory>},
{"engineStreamingGetUsedMemory", ArgumentParser<EngineStreamingGetUsedMemory>},
{"engineReinitMarkers", ArgumentParser<EngineReinitMarkers>},

// CLuaCFunctions::AddFunction ( "engineReplaceMatchingAtomics", EngineReplaceMatchingAtomics );
// CLuaCFunctions::AddFunction ( "engineReplaceWheelAtomics", EngineReplaceWheelAtomics );
Expand Down Expand Up @@ -2321,3 +2322,8 @@ bool CLuaEngineDefs::EngineRestreamWorld(lua_State* const luaVM)
g_pClientGame->RestreamWorld(restreamLODs);
return true;
}

void CLuaEngineDefs::EngineReinitMarkers()
{
g_pClientGame->ReinitMarkers();
}
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class CLuaEngineDefs : public CLuaDefs
static bool EngineRestreamWorld(lua_State* const luaVM);
static bool EngineSetModelVisibleTime(std::string strModelId, char cHourOn, char cHourOff);
static std::variant<bool, CLuaMultiReturn<char, char>> EngineGetModelVisibleTime(std::string strModelId);
static void EngineReinitMarkers();

private:
static void AddEngineColClass(lua_State* luaVM);
Expand Down
1 change: 1 addition & 0 deletions Client/sdk/game/C3DMarkers.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ class C3DMarkers
virtual C3DMarker* CreateMarker(DWORD Identifier, e3DMarkerType dwType, CVector* vecPosition, float fSize, float fPulseFraction, BYTE r, BYTE g, BYTE b,
BYTE a) = 0;
virtual C3DMarker* FindFreeMarker() = 0;
virtual void ReinitMarkers() = 0;
};