Skip to content

Commit dcce3ab

Browse files
authored
Merge branch 'master' into TheNormalnij/single_node_pool_resize
2 parents 749c4c9 + d18d7d3 commit dcce3ab

File tree

6 files changed

+39
-43
lines changed

6 files changed

+39
-43
lines changed

Client/game_sa/CAnimManagerSA.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,10 @@ static const char* const kGateWayAnimationName = "run_wuzi";
3232

3333
CAnimManagerSA::CAnimManagerSA()
3434
{
35-
MemSetFast(m_pAnimAssocGroups, 0, sizeof(m_pAnimAssocGroups));
36-
MemSetFast(m_pAnimBlocks, 0, sizeof(m_pAnimBlocks));
3735
}
3836

3937
CAnimManagerSA::~CAnimManagerSA()
4038
{
41-
for (unsigned int i = 0; i < MAX_ANIM_GROUPS; i++)
42-
if (m_pAnimAssocGroups[i])
43-
delete m_pAnimAssocGroups[i];
44-
for (unsigned int i = 0; i < MAX_ANIM_BLOCKS; i++)
45-
if (m_pAnimBlocks[i])
46-
delete m_pAnimBlocks[i];
4739
}
4840

4941
void CAnimManagerSA::Initialize()

Client/game_sa/CAnimManagerSA.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,4 @@ class CAnimManagerSA : public CAnimManager
165165

166166
bool IsValidGroup(std::uint32_t uiAnimGroup) const;
167167
bool IsValidAnim(std::uint32_t uiAnimGroup, std::uint32_t uiAnimID) const;
168-
private:
169-
CAnimBlendAssocGroup* m_pAnimAssocGroups[MAX_ANIM_GROUPS];
170-
CAnimBlock* m_pAnimBlocks[MAX_ANIM_BLOCKS];
171168
};

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5999,74 +5999,66 @@ bool CClientGame::IsGlitchEnabled(unsigned char ucGlitch)
59995999
return ucGlitch < NUM_GLITCHES && m_Glitches[ucGlitch];
60006000
}
60016001

6002-
bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled) noexcept
6002+
bool CClientGame::SetWorldSpecialProperty(const WorldSpecialProperty property, const bool enabled) noexcept
60036003
{
60046004
switch (property)
60056005
{
60066006
case WorldSpecialProperty::HOVERCARS:
60076007
case WorldSpecialProperty::AIRCARS:
60086008
case WorldSpecialProperty::EXTRABUNNY:
60096009
case WorldSpecialProperty::EXTRAJUMP:
6010-
g_pGame->SetCheatEnabled(EnumToString(property), isEnabled);
6010+
g_pGame->SetCheatEnabled(EnumToString(property), enabled);
60116011
break;
60126012
case WorldSpecialProperty::RANDOMFOLIAGE:
6013-
g_pGame->SetRandomFoliageEnabled(isEnabled);
6013+
g_pGame->SetRandomFoliageEnabled(enabled);
60146014
break;
60156015
case WorldSpecialProperty::SNIPERMOON:
6016-
g_pGame->SetMoonEasterEggEnabled(isEnabled);
6016+
g_pGame->SetMoonEasterEggEnabled(enabled);
60176017
break;
60186018
case WorldSpecialProperty::EXTRAAIRRESISTANCE:
6019-
g_pGame->SetExtraAirResistanceEnabled(isEnabled);
6019+
g_pGame->SetExtraAirResistanceEnabled(enabled);
60206020
break;
60216021
case WorldSpecialProperty::UNDERWORLDWARP:
6022-
g_pGame->SetUnderWorldWarpEnabled(isEnabled);
6022+
g_pGame->SetUnderWorldWarpEnabled(enabled);
60236023
break;
60246024
case WorldSpecialProperty::VEHICLESUNGLARE:
6025-
g_pGame->SetVehicleSunGlareEnabled(isEnabled);
6025+
g_pGame->SetVehicleSunGlareEnabled(enabled);
60266026
break;
60276027
case WorldSpecialProperty::CORONAZTEST:
6028-
g_pGame->SetCoronaZTestEnabled(isEnabled);
6028+
g_pGame->SetCoronaZTestEnabled(enabled);
60296029
break;
60306030
case WorldSpecialProperty::WATERCREATURES:
6031-
g_pGame->SetWaterCreaturesEnabled(isEnabled);
6031+
g_pGame->SetWaterCreaturesEnabled(enabled);
60326032
break;
60336033
case WorldSpecialProperty::BURNFLIPPEDCARS:
6034-
g_pGame->SetBurnFlippedCarsEnabled(isEnabled);
6034+
g_pGame->SetBurnFlippedCarsEnabled(enabled);
60356035
break;
60366036
case WorldSpecialProperty::FIREBALLDESTRUCT:
6037-
g_pGame->SetFireballDestructEnabled(isEnabled);
6037+
g_pGame->SetFireballDestructEnabled(enabled);
60386038
break;
60396039
case WorldSpecialProperty::EXTENDEDWATERCANNONS:
6040-
g_pGame->SetExtendedWaterCannonsEnabled(isEnabled);
6040+
g_pGame->SetExtendedWaterCannonsEnabled(enabled);
60416041
break;
60426042
case WorldSpecialProperty::ROADSIGNSTEXT:
6043-
g_pGame->SetRoadSignsTextEnabled(isEnabled);
6043+
g_pGame->SetRoadSignsTextEnabled(enabled);
60446044
break;
60456045
case WorldSpecialProperty::TUNNELWEATHERBLEND:
6046-
g_pGame->SetTunnelWeatherBlendEnabled(isEnabled);
6046+
g_pGame->SetTunnelWeatherBlendEnabled(enabled);
60476047
break;
60486048
case WorldSpecialProperty::IGNOREFIRESTATE:
6049-
g_pGame->SetIgnoreFireStateEnabled(isEnabled);
6049+
g_pGame->SetIgnoreFireStateEnabled(enabled);
60506050
break;
60516051
case WorldSpecialProperty::FLYINGCOMPONENTS:
6052-
m_pVehicleManager->SetSpawnFlyingComponentEnabled(isEnabled);
6052+
m_pVehicleManager->SetSpawnFlyingComponentEnabled(enabled);
60536053
break;
60546054
default:
60556055
return false;
60566056
}
60576057

6058-
if (g_pNet->CanServerBitStream(eBitStreamVersion::WorldSpecialPropertyEvent)) {
6059-
NetBitStreamInterface* stream = g_pNet->AllocateNetBitStream();
6060-
stream->WriteString(EnumToString(property));
6061-
stream->WriteBit(isEnabled);
6062-
g_pNet->SendPacket(PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY, stream, PACKET_PRIORITY_HIGH, PACKET_RELIABILITY_RELIABLE_ORDERED);
6063-
g_pNet->DeallocateNetBitStream(stream);
6064-
}
6065-
60666058
return true;
60676059
}
60686060

6069-
bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
6061+
bool CClientGame::IsWorldSpecialProperty(const WorldSpecialProperty property)
60706062
{
60716063
switch (property)
60726064
{
@@ -6104,6 +6096,7 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
61046096
case WorldSpecialProperty::FLYINGCOMPONENTS:
61056097
return m_pVehicleManager->IsSpawnFlyingComponentEnabled();
61066098
}
6099+
61076100
return false;
61086101
}
61096102

Client/mods/deathmatch/logic/CClientGame.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ class CClientGame
410410
bool SetGlitchEnabled(unsigned char cGlitch, bool bEnabled);
411411
bool IsGlitchEnabled(unsigned char cGlitch);
412412

413-
bool SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled) noexcept;
414-
bool IsWorldSpecialProperty(WorldSpecialProperty property);
413+
bool SetWorldSpecialProperty(const WorldSpecialProperty property, const bool enabled) noexcept;
414+
bool IsWorldSpecialProperty(const WorldSpecialProperty property);
415415

416416
bool SetCloudsEnabled(bool bEnabled);
417417
bool GetCloudsEnabled();

Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,14 +1266,28 @@ int CLuaWorldDefs::SetOcclusionsEnabled(lua_State* luaVM)
12661266
return 1;
12671267
}
12681268

1269-
bool CLuaWorldDefs::IsWorldSpecialPropertyEnabled(WorldSpecialProperty property)
1269+
bool CLuaWorldDefs::IsWorldSpecialPropertyEnabled(const WorldSpecialProperty property) noexcept
12701270
{
12711271
return m_pClientGame->IsWorldSpecialProperty(property);
12721272
}
12731273

1274-
bool CLuaWorldDefs::SetWorldSpecialPropertyEnabled(WorldSpecialProperty property, bool isEnabled)
1274+
bool CLuaWorldDefs::SetWorldSpecialPropertyEnabled(const WorldSpecialProperty property, const bool enabled) noexcept
12751275
{
1276-
return m_pClientGame->SetWorldSpecialProperty(property, isEnabled);
1276+
if (!m_pClientGame->SetWorldSpecialProperty(property, enabled))
1277+
return false;
1278+
1279+
if (!g_pNet->CanServerBitStream(eBitStreamVersion::WorldSpecialPropertyEvent))
1280+
return true;
1281+
1282+
if (auto stream = g_pNet->AllocateNetBitStream())
1283+
{
1284+
stream->WriteString(EnumToString(property));
1285+
stream->WriteBit(enabled);
1286+
g_pNet->SendPacket(PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY, stream, PACKET_PRIORITY_HIGH, PACKET_RELIABILITY_RELIABLE_ORDERED);
1287+
g_pNet->DeallocateNetBitStream(stream);
1288+
}
1289+
1290+
return true;
12771291
}
12781292

12791293
int CLuaWorldDefs::SetCloudsEnabled(lua_State* luaVM)

Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CLuaWorldDefs : public CLuaDefs
3434
LUA_DECLARE(GetGaragePosition);
3535
LUA_DECLARE(GetGarageSize);
3636
LUA_DECLARE(GetGarageBoundingBox);
37-
static bool IsWorldSpecialPropertyEnabled(WorldSpecialProperty property);
37+
static bool IsWorldSpecialPropertyEnabled(const WorldSpecialProperty property) noexcept;
3838
LUA_DECLARE(GetBlurLevel);
3939
LUA_DECLARE(GetTrafficLightState);
4040
LUA_DECLARE(AreTrafficLightsLocked);
@@ -57,7 +57,7 @@ class CLuaWorldDefs : public CLuaDefs
5757
LUA_DECLARE(SetMinuteDuration);
5858
LUA_DECLARE(SetWaveHeight);
5959
LUA_DECLARE(SetGarageOpen);
60-
static bool SetWorldSpecialPropertyEnabled(WorldSpecialProperty property, bool isEnabled);
60+
static bool SetWorldSpecialPropertyEnabled(const WorldSpecialProperty property, const bool enabled) noexcept;
6161
LUA_DECLARE(SetBlurLevel);
6262
LUA_DECLARE(ResetBlurLevel);
6363
LUA_DECLARE(SetJetpackMaxHeight);

0 commit comments

Comments
 (0)