@@ -1441,7 +1441,7 @@ bool CStaticFunctionDefinitions::SetElementModel(CClientEntity& Entity, unsigned
1441
1441
case CCLIENTPLAYER:
1442
1442
{
1443
1443
// Grab the model
1444
- CClientPed& Ped = static_cast <CClientPed&>(Entity);
1444
+ CClientPed& Ped = static_cast <CClientPed&>(Entity);
1445
1445
const unsigned short usCurrentModel = static_cast <ushort>(Ped.GetModel ());
1446
1446
1447
1447
if (usCurrentModel == usModel)
@@ -1458,7 +1458,7 @@ bool CStaticFunctionDefinitions::SetElementModel(CClientEntity& Entity, unsigned
1458
1458
}
1459
1459
case CCLIENTVEHICLE:
1460
1460
{
1461
- CClientVehicle& Vehicle = static_cast <CClientVehicle&>(Entity);
1461
+ CClientVehicle& Vehicle = static_cast <CClientVehicle&>(Entity);
1462
1462
const unsigned short usCurrentModel = Vehicle.GetModel ();
1463
1463
1464
1464
if (usCurrentModel == usModel)
@@ -1478,7 +1478,7 @@ bool CStaticFunctionDefinitions::SetElementModel(CClientEntity& Entity, unsigned
1478
1478
case CCLIENTOBJECT:
1479
1479
case CCLIENTWEAPON:
1480
1480
{
1481
- CClientObject& Object = static_cast <CClientObject&>(Entity);
1481
+ CClientObject& Object = static_cast <CClientObject&>(Entity);
1482
1482
const unsigned short usCurrentModel = Object.GetModel ();
1483
1483
1484
1484
if (usCurrentModel == usModel)
@@ -1497,7 +1497,7 @@ bool CStaticFunctionDefinitions::SetElementModel(CClientEntity& Entity, unsigned
1497
1497
}
1498
1498
case CCLIENTPROJECTILE:
1499
1499
{
1500
- CClientProjectile& Projectile = static_cast <CClientProjectile&>(Entity);
1500
+ CClientProjectile& Projectile = static_cast <CClientProjectile&>(Entity);
1501
1501
const unsigned short usCurrentModel = Projectile.GetModel ();
1502
1502
1503
1503
if (usCurrentModel == usModel)
@@ -1665,11 +1665,11 @@ bool CStaticFunctionDefinitions::GetPedAnalogControlState(CClientPed& Ped, const
1665
1665
if (Ped.GetType () == CCLIENTPLAYER)
1666
1666
{
1667
1667
CControllerState cs;
1668
- bool bOnFoot = (!Ped.GetRealOccupiedVehicle ());
1669
- unsigned int uiIndex;
1668
+ bool bOnFoot = (!Ped.GetRealOccupiedVehicle ());
1669
+ unsigned int uiIndex;
1670
1670
1671
1671
if (bRawInput)
1672
- cs = Ped.m_rawControllerState ; // use the raw controller values without MTA glitch fixes modifying our raw inputs
1672
+ cs = Ped.m_rawControllerState ; // use the raw controller values without MTA glitch fixes modifying our raw inputs
1673
1673
else
1674
1674
Ped.GetControllerState (cs);
1675
1675
@@ -2165,7 +2165,7 @@ bool CStaticFunctionDefinitions::SetPedAnimation(CClientEntity& Entity, const SS
2165
2165
// Play the gateway animation
2166
2166
const SString& strGateWayBlockName = g_pGame->GetAnimManager ()->GetGateWayBlockName ();
2167
2167
std::unique_ptr<CAnimBlock> pBlock = g_pGame->GetAnimManager ()->GetAnimationBlock (strGateWayBlockName);
2168
- auto pCustomAnimBlendHierarchy = pIFP->GetAnimationHierarchy (szAnimName);
2168
+ auto pCustomAnimBlendHierarchy = pIFP->GetAnimationHierarchy (szAnimName);
2169
2169
if ((pBlock) && (pCustomAnimBlendHierarchy != nullptr ))
2170
2170
{
2171
2171
Ped.SetNextAnimationCustom (pIFP, szAnimName);
@@ -7014,10 +7014,10 @@ bool CStaticFunctionDefinitions::GetAnalogControlState(const char* szControl, fl
7014
7014
{
7015
7015
CControllerState cs;
7016
7016
CClientPlayer* pLocalPlayer = m_pPlayerManager->GetLocalPlayer ();
7017
- bool bOnFoot = (!pLocalPlayer->GetRealOccupiedVehicle ());
7017
+ bool bOnFoot = (!pLocalPlayer->GetRealOccupiedVehicle ());
7018
7018
7019
7019
if (bRawInput)
7020
- cs = pLocalPlayer->m_rawControllerState ; // use the raw controller values without MTA glitch fixes modifying our raw inputs
7020
+ cs = pLocalPlayer->m_rawControllerState ; // use the raw controller values without MTA glitch fixes modifying our raw inputs
7021
7021
else
7022
7022
pLocalPlayer->GetControllerState (cs);
7023
7023
@@ -7211,6 +7211,130 @@ CClientColTube* CStaticFunctionDefinitions::CreateColTube(CResource& Resource, c
7211
7211
return pShape;
7212
7212
}
7213
7213
7214
+ bool CStaticFunctionDefinitions::GetColShapeRadius (CClientColShape* pColShape, float & fRadius )
7215
+ {
7216
+ switch (pColShape->GetShapeType ())
7217
+ {
7218
+ case COLSHAPE_CIRCLE:
7219
+ fRadius = static_cast <CClientColCircle*>(pColShape)->GetRadius ();
7220
+ break ;
7221
+ case COLSHAPE_SPHERE:
7222
+ fRadius = static_cast <CClientColSphere*>(pColShape)->GetRadius ();
7223
+ break ;
7224
+ case COLSHAPE_TUBE:
7225
+ fRadius = static_cast <CClientColTube*>(pColShape)->GetRadius ();
7226
+ break ;
7227
+ default :
7228
+ return false ;
7229
+ }
7230
+
7231
+ return true ;
7232
+ }
7233
+
7234
+ bool CStaticFunctionDefinitions::SetColShapeRadius (CClientColShape* pColShape, float fRadius )
7235
+ {
7236
+ if (fRadius < 0 .0f )
7237
+ fRadius = 0 .0f ;
7238
+
7239
+ switch (pColShape->GetShapeType ())
7240
+ {
7241
+ case COLSHAPE_CIRCLE:
7242
+ static_cast <CClientColCircle*>(pColShape)->SetRadius (fRadius );
7243
+ break ;
7244
+ case COLSHAPE_SPHERE:
7245
+ static_cast <CClientColSphere*>(pColShape)->SetRadius (fRadius );
7246
+ break ;
7247
+ case COLSHAPE_TUBE:
7248
+ static_cast <CClientColTube*>(pColShape)->SetRadius (fRadius );
7249
+ break ;
7250
+ default :
7251
+ return false ;
7252
+ }
7253
+
7254
+ RefreshColShapeColliders (pColShape);
7255
+
7256
+ return true ;
7257
+ }
7258
+
7259
+ bool CStaticFunctionDefinitions::SetColShapeSize (CClientColShape* pColShape, CVector& vecSize)
7260
+ {
7261
+ if (vecSize.fX < 0 .0f )
7262
+ vecSize.fX = 0 .0f ;
7263
+ if (vecSize.fY < 0 .0f )
7264
+ vecSize.fY = 0 .0f ;
7265
+ if (vecSize.fZ < 0 .0f )
7266
+ vecSize.fZ = 0 .0f ;
7267
+
7268
+ switch (pColShape->GetShapeType ())
7269
+ {
7270
+ case COLSHAPE_RECTANGLE:
7271
+ {
7272
+ static_cast <CClientColRectangle*>(pColShape)->SetSize (vecSize);
7273
+ break ;
7274
+ }
7275
+ case COLSHAPE_CUBOID:
7276
+ {
7277
+ static_cast <CClientColCuboid*>(pColShape)->SetSize (vecSize);
7278
+ break ;
7279
+ }
7280
+ case COLSHAPE_TUBE:
7281
+ {
7282
+ static_cast <CClientColTube*>(pColShape)->SetHeight (vecSize.fX );
7283
+ break ;
7284
+ }
7285
+ default :
7286
+ return false ;
7287
+ }
7288
+
7289
+ RefreshColShapeColliders (pColShape);
7290
+
7291
+ return true ;
7292
+ }
7293
+
7294
+ bool CStaticFunctionDefinitions::GetColPolygonPointPosition (CClientColPolygon* pColPolygon, uint uiPointIndex, CVector2D& vecPoint)
7295
+ {
7296
+ if (uiPointIndex < pColPolygon->CountPoints ())
7297
+ {
7298
+ vecPoint = *(pColPolygon->IterBegin () + uiPointIndex);
7299
+ return true ;
7300
+ }
7301
+
7302
+ return false ;
7303
+ }
7304
+
7305
+ bool CStaticFunctionDefinitions::SetColPolygonPointPosition (CClientColPolygon* pColPolygon, uint uiPointIndex, const CVector2D& vecPoint)
7306
+ {
7307
+ if (pColPolygon->SetPointPosition (uiPointIndex, vecPoint))
7308
+ {
7309
+ RefreshColShapeColliders (pColPolygon);
7310
+ return true ;
7311
+ }
7312
+
7313
+ return false ;
7314
+ }
7315
+
7316
+ bool CStaticFunctionDefinitions::AddColPolygonPoint (CClientColPolygon* pColPolygon, int iPointIndex, const CVector2D& vecPoint)
7317
+ {
7318
+ if (pColPolygon->AddPoint (vecPoint, iPointIndex))
7319
+ {
7320
+ RefreshColShapeColliders (pColPolygon);
7321
+ return true ;
7322
+ }
7323
+
7324
+ return false ;
7325
+ }
7326
+
7327
+ bool CStaticFunctionDefinitions::RemoveColPolygonPoint (CClientColPolygon* pColPolygon, uint uiPointIndex)
7328
+ {
7329
+ if (pColPolygon->RemovePoint (uiPointIndex))
7330
+ {
7331
+ RefreshColShapeColliders (pColPolygon);
7332
+ return true ;
7333
+ }
7334
+
7335
+ return false ;
7336
+ }
7337
+
7214
7338
// Make sure all colliders for a colshape are up to date
7215
7339
void CStaticFunctionDefinitions::RefreshColShapeColliders (CClientColShape* pColShape)
7216
7340
{
0 commit comments