Skip to content

Commit 695d28b

Browse files
committed
Logic
1 parent 1e7893c commit 695d28b

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

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

6001-
bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool isEnabled) noexcept
6001+
bool CClientGame::SetWorldSpecialProperty(const WorldSpecialProperty property, const bool enabled) noexcept
60026002
{
60036003
switch (property)
60046004
{
60056005
case WorldSpecialProperty::HOVERCARS:
60066006
case WorldSpecialProperty::AIRCARS:
60076007
case WorldSpecialProperty::EXTRABUNNY:
60086008
case WorldSpecialProperty::EXTRAJUMP:
6009-
g_pGame->SetCheatEnabled(EnumToString(property), isEnabled);
6009+
g_pGame->SetCheatEnabled(EnumToString(property), enabled);
60106010
break;
60116011
case WorldSpecialProperty::RANDOMFOLIAGE:
6012-
g_pGame->SetRandomFoliageEnabled(isEnabled);
6012+
g_pGame->SetRandomFoliageEnabled(enabled);
60136013
break;
60146014
case WorldSpecialProperty::SNIPERMOON:
6015-
g_pGame->SetMoonEasterEggEnabled(isEnabled);
6015+
g_pGame->SetMoonEasterEggEnabled(enabled);
60166016
break;
60176017
case WorldSpecialProperty::EXTRAAIRRESISTANCE:
6018-
g_pGame->SetExtraAirResistanceEnabled(isEnabled);
6018+
g_pGame->SetExtraAirResistanceEnabled(enabled);
60196019
break;
60206020
case WorldSpecialProperty::UNDERWORLDWARP:
6021-
g_pGame->SetUnderWorldWarpEnabled(isEnabled);
6021+
g_pGame->SetUnderWorldWarpEnabled(enabled);
60226022
break;
60236023
case WorldSpecialProperty::VEHICLESUNGLARE:
6024-
g_pGame->SetVehicleSunGlareEnabled(isEnabled);
6024+
g_pGame->SetVehicleSunGlareEnabled(enabled);
60256025
break;
60266026
case WorldSpecialProperty::CORONAZTEST:
6027-
g_pGame->SetCoronaZTestEnabled(isEnabled);
6027+
g_pGame->SetCoronaZTestEnabled(enabled);
60286028
break;
60296029
case WorldSpecialProperty::WATERCREATURES:
6030-
g_pGame->SetWaterCreaturesEnabled(isEnabled);
6030+
g_pGame->SetWaterCreaturesEnabled(enabled);
60316031
break;
60326032
case WorldSpecialProperty::BURNFLIPPEDCARS:
6033-
g_pGame->SetBurnFlippedCarsEnabled(isEnabled);
6033+
g_pGame->SetBurnFlippedCarsEnabled(enabled);
60346034
break;
60356035
case WorldSpecialProperty::FIREBALLDESTRUCT:
6036-
g_pGame->SetFireballDestructEnabled(isEnabled);
6036+
g_pGame->SetFireballDestructEnabled(enabled);
60376037
break;
60386038
case WorldSpecialProperty::EXTENDEDWATERCANNONS:
6039-
g_pGame->SetExtendedWaterCannonsEnabled(isEnabled);
6039+
g_pGame->SetExtendedWaterCannonsEnabled(enabled);
60406040
break;
60416041
case WorldSpecialProperty::ROADSIGNSTEXT:
6042-
g_pGame->SetRoadSignsTextEnabled(isEnabled);
6042+
g_pGame->SetRoadSignsTextEnabled(enabled);
60436043
break;
60446044
case WorldSpecialProperty::TUNNELWEATHERBLEND:
6045-
g_pGame->SetTunnelWeatherBlendEnabled(isEnabled);
6045+
g_pGame->SetTunnelWeatherBlendEnabled(enabled);
60466046
break;
60476047
case WorldSpecialProperty::IGNOREFIRESTATE:
6048-
g_pGame->SetIgnoreFireStateEnabled(isEnabled);
6048+
g_pGame->SetIgnoreFireStateEnabled(enabled);
60496049
break;
60506050
case WorldSpecialProperty::FLYINGCOMPONENTS:
6051-
m_pVehicleManager->SetSpawnFlyingComponentEnabled(isEnabled);
6051+
m_pVehicleManager->SetSpawnFlyingComponentEnabled(enabled);
60526052
break;
60536053
default:
60546054
return false;
60556055
}
60566056

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

6068-
bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
6060+
bool CClientGame::IsWorldSpecialProperty(const WorldSpecialProperty property)
60696061
{
60706062
switch (property)
60716063
{
@@ -6103,6 +6095,7 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property)
61036095
case WorldSpecialProperty::FLYINGCOMPONENTS:
61046096
return m_pVehicleManager->IsSpawnFlyingComponentEnabled();
61056097
}
6098+
61066099
return false;
61076100
}
61086101

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();

0 commit comments

Comments
 (0)