@@ -1076,6 +1076,9 @@ bool CStaticFunctionDefinitions::SetElementPosition(CClientEntity& Entity, const
1076
1076
{
1077
1077
RUN_CHILDREN (SetElementPosition (**iter, vecPosition))
1078
1078
1079
+ if (!Entity.IsLocalEntity ())
1080
+ return false ;
1081
+
1079
1082
if (bWarp)
1080
1083
Entity.Teleport (vecPosition);
1081
1084
else
@@ -1491,6 +1494,9 @@ bool CStaticFunctionDefinitions::SetElementHealth(CClientEntity& Entity, float f
1491
1494
{
1492
1495
RUN_CHILDREN (SetElementHealth (**iter, fHealth ))
1493
1496
1497
+ if (!Entity.IsLocalEntity ())
1498
+ return false ;
1499
+
1494
1500
switch (Entity.GetType ())
1495
1501
{
1496
1502
case CCLIENTPED:
@@ -2907,41 +2913,13 @@ bool CStaticFunctionDefinitions::BlowVehicle(CClientEntity& Entity, std::optiona
2907
2913
return false ;
2908
2914
2909
2915
CClientVehicle& vehicle = static_cast <CClientVehicle&>(Entity);
2910
- VehicleBlowFlags blow;
2916
+ if (!vehicle.IsLocalEntity ())
2917
+ return false ;
2911
2918
2919
+ VehicleBlowFlags blow;
2920
+
2912
2921
blow.withExplosion = withExplosion.value_or (true );
2913
-
2914
- if (vehicle.IsLocalEntity ())
2915
- {
2916
- vehicle.Blow (blow);
2917
- }
2918
- else
2919
- {
2920
- CVector position;
2921
- vehicle.GetPosition (position);
2922
-
2923
- const auto type = vehicle.GetType ();
2924
- const auto state = (blow.withExplosion ? VehicleBlowState::AWAITING_EXPLOSION_SYNC : VehicleBlowState::BLOWN);
2925
- eExplosionType explosion;
2926
-
2927
- switch (type)
2928
- {
2929
- case CLIENTVEHICLE_CAR:
2930
- explosion = EXP_TYPE_CAR;
2931
- break ;
2932
- case CLIENTVEHICLE_HELI:
2933
- explosion = EXP_TYPE_HELI;
2934
- break ;
2935
- case CLIENTVEHICLE_BOAT:
2936
- explosion = EXP_TYPE_BOAT;
2937
- break ;
2938
- default :
2939
- explosion = EXP_TYPE_CAR;
2940
- }
2941
-
2942
- g_pClientGame->SendExplosionSync (position, explosion, &Entity, state);
2943
- }
2944
-
2922
+ vehicle.Blow (blow);
2945
2923
return true ;
2946
2924
}
2947
2925
0 commit comments