@@ -2661,20 +2661,18 @@ CClientVehicle* CStaticFunctionDefinitions::CreateVehicle(CResource& Resource, u
2661
2661
CClientVehicleManager::GetRandomVariation (usModel, ucVariation, ucVariation2);
2662
2662
2663
2663
CClientVehicle* pVehicle = new CDeathmatchVehicle (m_pManager, NULL , INVALID_ELEMENT_ID, usModel, ucVariation, ucVariation2);
2664
- if (pVehicle)
2665
- {
2666
- pVehicle->SetParent (Resource.GetResourceDynamicEntity ());
2667
- pVehicle->SetPosition (vecPosition);
2668
2664
2669
- pVehicle->SetRotationDegrees (vecRotation);
2670
- if (szRegPlate)
2671
- pVehicle->SetRegPlate (szRegPlate);
2665
+ pVehicle->SetParent (Resource.GetResourceDynamicEntity ());
2666
+ pVehicle->SetPosition (vecPosition);
2672
2667
2673
- return pVehicle;
2674
- }
2668
+ pVehicle->SetRotationDegrees (vecRotation);
2669
+ if (szRegPlate)
2670
+ pVehicle->SetRegPlate (szRegPlate);
2671
+
2672
+ return pVehicle;
2675
2673
}
2676
2674
2677
- return NULL ;
2675
+ return nullptr ;
2678
2676
}
2679
2677
2680
2678
bool CStaticFunctionDefinitions::FixVehicle (CClientEntity& Entity)
@@ -3738,17 +3736,15 @@ CClientObject* CStaticFunctionDefinitions::CreateObject(CResource& Resource, uns
3738
3736
#else
3739
3737
CClientObject* pObject = new CDeathmatchObject (m_pManager, m_pMovingObjectsManager, INVALID_ELEMENT_ID, usModelID, bLowLod);
3740
3738
#endif
3741
- if (pObject)
3742
- {
3743
- pObject->SetParent (Resource.GetResourceDynamicEntity ());
3744
- pObject->SetPosition (vecPosition);
3745
- pObject->SetRotationDegrees (vecRotation);
3746
3739
3747
- return pObject;
3748
- }
3740
+ pObject->SetParent (Resource.GetResourceDynamicEntity ());
3741
+ pObject->SetPosition (vecPosition);
3742
+ pObject->SetRotationDegrees (vecRotation);
3743
+
3744
+ return pObject;
3749
3745
}
3750
3746
3751
- return NULL ;
3747
+ return nullptr ;
3752
3748
}
3753
3749
3754
3750
bool CStaticFunctionDefinitions::GetObjectScale (CClientObject& Object, CVector& vecScale)
@@ -3969,17 +3965,13 @@ CClientRadarArea* CStaticFunctionDefinitions::CreateRadarArea(CResource& Resourc
3969
3965
{
3970
3966
// Create it
3971
3967
CClientRadarArea* pRadarArea = new CClientRadarArea (m_pManager, INVALID_ELEMENT_ID);
3972
- if (pRadarArea)
3973
- {
3974
- pRadarArea->SetParent (Resource.GetResourceDynamicEntity ());
3975
- pRadarArea->SetPosition (vecPosition2D);
3976
- pRadarArea->SetSize (vecSize);
3977
- pRadarArea->SetColor (color);
3978
3968
3979
- return pRadarArea;
3980
- }
3969
+ pRadarArea->SetParent (Resource.GetResourceDynamicEntity ());
3970
+ pRadarArea->SetPosition (vecPosition2D);
3971
+ pRadarArea->SetSize (vecSize);
3972
+ pRadarArea->SetColor (color);
3981
3973
3982
- return NULL ;
3974
+ return pRadarArea ;
3983
3975
}
3984
3976
3985
3977
bool CStaticFunctionDefinitions::GetRadarAreaColor (CClientRadarArea* RadarArea, SColor& outColor)
@@ -4321,14 +4313,13 @@ CClientRadarMarker* CStaticFunctionDefinitions::CreateBlip(CResource& Resource,
4321
4313
if (CClientRadarMarkerManager::IsValidIcon (ucIcon) && ucSize <= 25 )
4322
4314
{
4323
4315
CClientRadarMarker* pBlip = new CClientRadarMarker (m_pManager, INVALID_ELEMENT_ID, sOrdering , usVisibleDistance);
4324
- if (pBlip)
4325
- {
4326
- pBlip->SetParent (Resource.GetResourceDynamicEntity ());
4327
- pBlip->SetPosition (vecPosition);
4328
- pBlip->SetSprite (ucIcon);
4329
- pBlip->SetScale (ucSize);
4330
- pBlip->SetColor (color);
4331
- }
4316
+
4317
+ pBlip->SetParent (Resource.GetResourceDynamicEntity ());
4318
+ pBlip->SetPosition (vecPosition);
4319
+ pBlip->SetSprite (ucIcon);
4320
+ pBlip->SetScale (ucSize);
4321
+ pBlip->SetColor (color);
4322
+
4332
4323
return pBlip;
4333
4324
}
4334
4325
@@ -4343,14 +4334,13 @@ CClientRadarMarker* CStaticFunctionDefinitions::CreateBlipAttachedTo(CResource&
4343
4334
if (CClientRadarMarkerManager::IsValidIcon (ucIcon) && ucSize <= 25 )
4344
4335
{
4345
4336
CClientRadarMarker* pBlip = new CClientRadarMarker (m_pManager, INVALID_ELEMENT_ID, sOrdering , usVisibleDistance);
4346
- if (pBlip)
4347
- {
4348
- pBlip->SetParent (Resource.GetResourceDynamicEntity ());
4349
- pBlip->AttachTo (&Entity);
4350
- pBlip->SetSprite (ucIcon);
4351
- pBlip->SetScale (ucSize);
4352
- pBlip->SetColor (color);
4353
- }
4337
+
4338
+ pBlip->SetParent (Resource.GetResourceDynamicEntity ());
4339
+ pBlip->AttachTo (&Entity);
4340
+ pBlip->SetSprite (ucIcon);
4341
+ pBlip->SetScale (ucSize);
4342
+ pBlip->SetColor (color);
4343
+
4354
4344
return pBlip;
4355
4345
}
4356
4346
@@ -9395,19 +9385,15 @@ CClientPointLights* CStaticFunctionDefinitions::CreateLight(CResource& Resource,
9395
9385
{
9396
9386
// Create it
9397
9387
CClientPointLights* pLight = new CClientPointLights (m_pManager, INVALID_ELEMENT_ID);
9398
- if (pLight)
9399
- {
9400
- pLight->SetParent (Resource.GetResourceDynamicEntity ());
9401
- pLight->SetMode (iMode);
9402
- pLight->SetPosition (vecPosition);
9403
- pLight->SetRadius (fRadius );
9404
- pLight->SetColor (color);
9405
- pLight->SetDirection (vecDirection);
9406
9388
9407
- return pLight;
9408
- }
9389
+ pLight->SetParent (Resource.GetResourceDynamicEntity ());
9390
+ pLight->SetMode (iMode);
9391
+ pLight->SetPosition (vecPosition);
9392
+ pLight->SetRadius (fRadius );
9393
+ pLight->SetColor (color);
9394
+ pLight->SetDirection (vecDirection);
9409
9395
9410
- return NULL ;
9396
+ return pLight ;
9411
9397
}
9412
9398
9413
9399
bool CStaticFunctionDefinitions::GetLightType (CClientPointLights* pLight, int & iMode)
0 commit comments