Skip to content

Commit

Permalink
Rename to resetWorldProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX committed Sep 2, 2024
1 parent 38cb8be commit be4b8d1
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5417,7 +5417,7 @@ void CClientGame::ResetMapInfo()
m_bHudAreaNameDisabled = false;

// Reset world special properties, world properties, weather properties etc
ResetAllWorldProperties(true, true, true, true, true);
ResetWorldProperties(true, true, true, true, true);

// Wanted-level
SetWanted(0);
Expand Down Expand Up @@ -6731,7 +6731,7 @@ void CClientGame::ReinitMarkers()
g_pGame->Get3DMarkers()->ReinitMarkers();
}

void CClientGame::ResetAllWorldProperties(bool resetSpecialProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds)
void CClientGame::ResetWorldProperties(bool resetSpecialProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds)
{
// Reset all setWorldSpecialPropertyEnabled to default
if (resetSpecialProperties)
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CClientGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class CClientGame
bool SetBirdsEnabled(bool bEnabled);
bool GetBirdsEnabled();

void ResetAllWorldProperties(bool resetSpecialWorldProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds);
void ResetWorldProperties(bool resetSpecialWorldProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds);

CTransferBox* GetTransferBox() { return m_pTransferBox; };

Expand Down
6 changes: 3 additions & 3 deletions Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void CLuaWorldDefs::LoadFunctions()
{"resetBlurLevel", ResetBlurLevel},
{"resetWorldProperty", ArgumentParserWarn<false, ResetWorldProperty>},
{"resetTimeFrozen", ArgumentParser<ResetTimeFrozen>},
{"resetAllWorldProperties", ArgumentParser<ResetAllWorldProperties>},
{"resetWorldProperties", ArgumentParser<ResetWorldProperties>},

// World check funcs
{"areTrafficLightsLocked", AreTrafficLightsLocked},
Expand Down Expand Up @@ -2255,7 +2255,7 @@ bool CLuaWorldDefs::ResetTimeFrozen() noexcept
return g_pGame->GetClock()->ResetTimeFrozen();
}

void CLuaWorldDefs::ResetAllWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds) noexcept
void CLuaWorldDefs::ResetWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds) noexcept
{
g_pClientGame->ResetAllWorldProperties(resetSpecialWorldProperties.value_or(true), resetWorldProperties.value_or(true), resetWeatherProperties.value_or(true), resetLODs.value_or(true), resetSounds.value_or(true));
g_pClientGame->ResetWorldProperties(resetSpecialWorldProperties.value_or(true), resetWorldProperties.value_or(true), resetWeatherProperties.value_or(true), resetLODs.value_or(true), resetSounds.value_or(true));
}
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ class CLuaWorldDefs : public CLuaDefs
static bool IsTimeFrozen() noexcept;
static bool ResetTimeFrozen() noexcept;

static void ResetAllWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds) noexcept;
static void ResetWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds) noexcept;
};

6 changes: 3 additions & 3 deletions Client/mods/deathmatch/logic/rpc/CWorldRPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void CWorldRPCs::LoadFunctions()

AddHandler(SET_WORLD_SPECIAL_PROPERTY, SetWorldSpecialPropertyEnabled, "SetWorldSpecialPropertyEnabled");

AddHandler(RESET_ALL_WORLD_PROPERTIES, ResetAllWorldProperties, "ResetAllWorldProperties");
AddHandler(RESET_WORLD_PROPERTIES, ResetWorldProperties, "ResetWorldProperties");
}

void CWorldRPCs::SetTime(NetBitStreamInterface& bitStream)
Expand Down Expand Up @@ -646,13 +646,13 @@ void CWorldRPCs::SetWorldSpecialPropertyEnabled(NetBitStreamInterface& bitStream
}
}

void CWorldRPCs::ResetAllWorldProperties(NetBitStreamInterface& bitStream)
void CWorldRPCs::ResetWorldProperties(NetBitStreamInterface& bitStream)
{
bool resetSpecialProperties = bitStream.ReadBit();
bool resetWorldProperties = bitStream.ReadBit();
bool resetWeatherProperties = bitStream.ReadBit();
bool resetLODs = bitStream.ReadBit();
bool resetSounds = bitStream.ReadBit();

g_pClientGame->ResetAllWorldProperties(resetSpecialProperties, resetWorldProperties, resetWeatherProperties, resetLODs, resetSounds);
g_pClientGame->ResetWorldProperties(resetSpecialProperties, resetWorldProperties, resetWeatherProperties, resetLODs, resetSounds);
}
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/rpc/CWorldRPCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ class CWorldRPCs : public CRPCFunctions
DECLARE_RPC(ResetMoonSize);
DECLARE_RPC(SetSyncIntervals);
DECLARE_RPC(SetWorldSpecialPropertyEnabled);
DECLARE_RPC(ResetAllWorldProperties);
DECLARE_RPC(ResetWorldProperties);
};
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4396,7 +4396,7 @@ void CGame::SetJetpackWeaponEnabled(eWeaponType weaponType, bool bEnabled)
}
}

void CGame::ResetAllWorldProperties(bool resetSpecialProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds, bool resetGlitches, bool resetJetpackWeapons)
void CGame::ResetWorldProperties(bool resetSpecialProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds, bool resetGlitches, bool resetJetpackWeapons)
{
// Reset all setWorldSpecialPropertyEnabled to default
if (resetSpecialProperties)
Expand Down Expand Up @@ -4498,7 +4498,7 @@ void CGame::ResetAllWorldProperties(bool resetSpecialProperties, bool resetWorld
bitStream->WriteBit(resetWeatherProperties);
bitStream->WriteBit(resetLODs);
bitStream->WriteBit(resetSounds);
m_pPlayerManager->BroadcastOnlyJoined(CLuaPacket(RESET_ALL_WORLD_PROPERTIES, *bitStream.pBitStream));
m_pPlayerManager->BroadcastOnlyJoined(CLuaPacket(RESET_WORLD_PROPERTIES, *bitStream.pBitStream));
}

//
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class CGame
int GetMoonSize() { return m_iMoonSize; }
void SetMoonSize(int iMoonSize) { m_iMoonSize = iMoonSize; }

void ResetAllWorldProperties(bool resetSpecialWorldProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds, bool resetGlitches, bool resetJetpackWeapons);
void ResetWorldProperties(bool resetSpecialWorldProperties, bool resetWorldProperties, bool resetWeatherProperties, bool resetLODs, bool resetSounds, bool resetGlitches, bool resetJetpackWeapons);

void PrintLogOutputFromNetModule();
void StartOpenPortsTest();
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CPerfStat.RPCPacketUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ ADD_ENUM1(SET_COLPOLYGON_HEIGHT)
ADD_ENUM1(SET_OBJECT_BREAKABLE)
ADD_ENUM1(BREAK_OBJECT)
ADD_ENUM1(SET_PLAYER_SCRIPT_DEBUG_LEVEL)
ADD_ENUM1(RESET_ALL_WORLD_PROPERTIES)
ADD_ENUM1(RESET_WORLD_PROPERTIES)
IMPLEMENT_ENUM_END("eElementRPCFunctions")

DECLARE_ENUM(CRPCFunctions::eRPCFunctions);
Expand Down
6 changes: 3 additions & 3 deletions Server/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void CLuaWorldDefs::LoadFunctions()
{"restoreWorldModel", RestoreWorldModel},
{"restoreAllWorldModels", RestoreAllWorldModels},
{"resetMoonSize", resetMoonSize},
{"resetAllWorldProperties", ArgumentParser<ResetAllWorldProperties>},
{"resetWorldProperties", ArgumentParser<ResetWorldProperties>},

// Check
{"isGarageOpen", isGarageOpen},
Expand Down Expand Up @@ -1450,7 +1450,7 @@ int CLuaWorldDefs::getOcclusionsEnabled(lua_State* luaVM)
return 1;
}

void CLuaWorldDefs::ResetAllWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds, std::optional<bool> resetGlitches, std::optional<bool> resetJetpackWeapons) noexcept
void CLuaWorldDefs::ResetWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds, std::optional<bool> resetGlitches, std::optional<bool> resetJetpackWeapons) noexcept
{
g_pGame->ResetAllWorldProperties(resetSpecialWorldProperties.value_or(true), resetWorldProperties.value_or(true), resetWeatherProperties.value_or(true), resetLODs.value_or(true), resetSounds.value_or(true), resetGlitches.value_or(true), resetJetpackWeapons.value_or(true));
g_pGame->ResetWorldProperties(resetSpecialWorldProperties.value_or(true), resetWorldProperties.value_or(true), resetWeatherProperties.value_or(true), resetLODs.value_or(true), resetSounds.value_or(true), resetGlitches.value_or(true), resetJetpackWeapons.value_or(true));
}
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ class CLuaWorldDefs : public CLuaDefs
LUA_DECLARE(RestoreAllWorldModels);
LUA_DECLARE(resetMoonSize);

static void ResetAllWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds, std::optional<bool> resetGlitches, std::optional<bool> resetJetpackWeapons) noexcept;
static void ResetWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds, std::optional<bool> resetGlitches, std::optional<bool> resetJetpackWeapons) noexcept;
};
2 changes: 1 addition & 1 deletion Shared/sdk/net/rpc_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ enum eElementRPCFunctions

SET_MARKER_TARGET_ARROW_PROPERTIES,

RESET_ALL_WORLD_PROPERTIES,
RESET_WORLD_PROPERTIES,

NUM_RPC_FUNCS // Add above this line
};

0 comments on commit be4b8d1

Please sign in to comment.