diff --git a/.gitignore b/.gitignore index 7a09b4a..557da3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ **/bin **/obj **/packages -**/.vs \ No newline at end of file +**/.vs +**/.vscode \ No newline at end of file diff --git a/RageCoop.Client/Sync/Entities/SyncedVehicle.cs b/RageCoop.Client/Sync/Entities/SyncedVehicle.cs index 5c94054..eac24ab 100644 --- a/RageCoop.Client/Sync/Entities/SyncedVehicle.cs +++ b/RageCoop.Client/Sync/Entities/SyncedVehicle.cs @@ -241,6 +241,18 @@ namespace RageCoop.Client MainVehicle.RoofState=RoofState; } + if(MainVehicle.HasRocketBoost){ + if(Flags.HasFlag(VehicleDataFlags.IsRocketBoostActive) ) + { + if(!MainVehicle.IsRocketBoostActive()){ + MainVehicle.SetRocketBoostActive(true); + } + } + else if(MainVehicle.IsRocketBoostActive()){ + MainVehicle.SetRocketBoostActive(false); + } + } + Function.Call(Hash.SET_VEHICLE_BRAKE_LIGHTS, MainVehicle.Handle, BrakeLightsOn); MainVehicle.SetDamageModel(DamageModel); diff --git a/RageCoop.Client/Util/VehicleExtensions.cs b/RageCoop.Client/Util/VehicleExtensions.cs index 0ca35b5..6af844f 100644 --- a/RageCoop.Client/Util/VehicleExtensions.cs +++ b/RageCoop.Client/Util/VehicleExtensions.cs @@ -54,11 +54,6 @@ namespace RageCoop.Client flags |= VehicleDataFlags.IsTransformed; } - if (veh.HasRoof && (veh.RoofState == VehicleRoofState.Opened || veh.RoofState == VehicleRoofState.Opening)) - { - flags |= VehicleDataFlags.RoofOpened; - } - if (veh.IsAircraft) { @@ -72,6 +67,10 @@ namespace RageCoop.Client { flags|=VehicleDataFlags.HasRoof; } + if (veh.IsRocketBoostActive()) + { + flags|=VehicleDataFlags.IsRocketBoostActive; + } if (veh.IsOnFire) { flags|=VehicleDataFlags.IsOnFire; @@ -80,7 +79,14 @@ namespace RageCoop.Client return flags; } - + public static bool IsRocketBoostActive(this Vehicle veh) + { + return Function.Call(Hash._IS_VEHICLE_ROCKET_BOOST_ACTIVE,veh); + } + public static void SetRocketBoostActive(this Vehicle veh,bool toggle) + { + Function.Call(Hash._SET_VEHICLE_ROCKET_BOOST_ACTIVE,veh,toggle); + } public static Dictionary GetVehicleMods(this VehicleModCollection mods) { Dictionary result = new Dictionary(); diff --git a/RageCoop.Core/Packets/Packets.cs b/RageCoop.Core/Packets/Packets.cs index fa38686..a6790a8 100644 --- a/RageCoop.Core/Packets/Packets.cs +++ b/RageCoop.Core/Packets/Packets.cs @@ -121,8 +121,7 @@ namespace RageCoop.Core IsDead = 1 << 5, IsHornActive = 1 << 6, IsTransformed = 1 << 7, - RoofOpened = 1 << 8, - OnTurretSeat = 1 << 9, + IsRocketBoostActive = 1 << 9, IsAircraft = 1 << 10, IsDeluxoHovering=1 << 11, HasRoof=1 << 12,