We don't need that flag

This commit is contained in:
EntenKoeniq 2021-11-19 09:24:06 +01:00
parent 6eee37c594
commit 27b7b96bfd
5 changed files with 22 additions and 34 deletions

View File

@ -264,7 +264,7 @@ namespace CoopClient
DebugSyncPed.IsJumping = (flags.Value & (byte)PedDataFlags.IsJumping) > 0;
DebugSyncPed.IsRagdoll = (flags.Value & (byte)PedDataFlags.IsRagdoll) > 0;
DebugSyncPed.IsOnFire = (flags.Value & (byte)PedDataFlags.IsOnFire) > 0;
DebugSyncPed.IsInVehicle = (flags.Value & (byte)PedDataFlags.IsInVehicle) > 0;
DebugSyncPed.IsInVehicle = false;
if (DebugSyncPed.Character != null && DebugSyncPed.Character.Exists())
{
@ -300,7 +300,7 @@ namespace CoopClient
DebugSyncPed.VehDoors = veh.Doors.GetVehicleDoors();
DebugSyncPed.VehTires = veh.Wheels.GetBrokenTires();
DebugSyncPed.LastSyncWasFull = (flags.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0;
DebugSyncPed.IsInVehicle = (flags.Value & (byte)VehicleDataFlags.IsInVehicle) > 0;
DebugSyncPed.IsInVehicle = true;
DebugSyncPed.VehIsEngineRunning = (flags.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0;
DebugSyncPed.VehAreLightsOn = (flags.Value & (byte)VehicleDataFlags.AreLightsOn) > 0;
DebugSyncPed.VehAreHighBeamsOn = (flags.Value & (byte)VehicleDataFlags.AreHighBeamsOn) > 0;

View File

@ -301,7 +301,7 @@ namespace CoopClient
player.IsJumping = (packet.Flag.Value & (byte)PedDataFlags.IsJumping) > 0;
player.IsRagdoll = (packet.Flag.Value & (byte)PedDataFlags.IsRagdoll) > 0;
player.IsOnFire = (packet.Flag.Value & (byte)PedDataFlags.IsOnFire) > 0;
player.IsInVehicle = (packet.Flag.Value & (byte)PedDataFlags.IsInVehicle) > 0;
player.IsInVehicle = false;
player.Latency = packet.Extra.Latency;
player.LastUpdateReceived = Environment.TickCount;
@ -332,7 +332,7 @@ namespace CoopClient
player.VehDoors = packet.VehDoors;
player.VehTires = packet.VehTires;
player.LastSyncWasFull = (packet.Flag.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0;
player.IsInVehicle = (packet.Flag.Value & (byte)VehicleDataFlags.IsInVehicle) > 0;
player.IsInVehicle = true;
player.VehIsEngineRunning = (packet.Flag.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0;
player.VehAreLightsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreLightsOn) > 0;
player.VehAreHighBeamsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreHighBeamsOn) > 0;
@ -364,7 +364,7 @@ namespace CoopClient
player.IsJumping = (packet.Flag.Value & (byte)PedDataFlags.IsJumping) > 0;
player.IsRagdoll = (packet.Flag.Value & (byte)PedDataFlags.IsRagdoll) > 0;
player.IsOnFire = (packet.Flag.Value & (byte)PedDataFlags.IsOnFire) > 0;
player.IsInVehicle = (packet.Flag.Value & (byte)PedDataFlags.IsInVehicle) > 0;
player.IsInVehicle = false;
player.Latency = packet.Extra.Latency;
player.LastUpdateReceived = Environment.TickCount;
@ -387,7 +387,7 @@ namespace CoopClient
player.VehicleSpeed = packet.VehSpeed;
player.VehicleSteeringAngle = packet.VehSteeringAngle;
player.LastSyncWasFull = (packet.Flag.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0;
player.IsInVehicle = (packet.Flag.Value & (byte)VehicleDataFlags.IsInVehicle) > 0;
player.IsInVehicle = true;
player.VehIsEngineRunning = (packet.Flag.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0;
player.VehAreLightsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreLightsOn) > 0;
player.VehAreHighBeamsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreHighBeamsOn) > 0;
@ -481,7 +481,7 @@ namespace CoopClient
npc.IsJumping = (packet.Flag.Value & (byte)PedDataFlags.IsJumping) > 0;
npc.IsRagdoll = (packet.Flag.Value & (byte)PedDataFlags.IsRagdoll) > 0;
npc.IsOnFire = (packet.Flag.Value & (byte)PedDataFlags.IsOnFire) > 0;
npc.IsInVehicle = (packet.Flag.Value & (byte)PedDataFlags.IsInVehicle) > 0;
npc.IsInVehicle = false;
}
else
{
@ -505,7 +505,7 @@ namespace CoopClient
IsJumping = (packet.Flag.Value & (byte)PedDataFlags.IsJumping) > 0,
IsRagdoll = (packet.Flag.Value & (byte)PedDataFlags.IsRagdoll) > 0,
IsOnFire = (packet.Flag.Value & (byte)PedDataFlags.IsOnFire) > 0,
IsInVehicle = (packet.Flag.Value & (byte)PedDataFlags.IsInVehicle) > 0
IsInVehicle = false
});
}
}
@ -538,7 +538,7 @@ namespace CoopClient
npc.VehDoors = packet.VehDoors;
npc.VehTires = packet.VehTires;
npc.LastSyncWasFull = (packet.Flag.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0;
npc.IsInVehicle = (packet.Flag.Value & (byte)VehicleDataFlags.IsInVehicle) > 0;
npc.IsInVehicle = true;
npc.VehIsEngineRunning = (packet.Flag.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0;
npc.VehAreLightsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreLightsOn) > 0;
npc.VehAreHighBeamsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreHighBeamsOn) > 0;
@ -568,7 +568,7 @@ namespace CoopClient
VehDoors = packet.VehDoors,
VehTires = packet.VehTires,
LastSyncWasFull = (packet.Flag.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0,
IsInVehicle = (packet.Flag.Value & (byte)VehicleDataFlags.IsInVehicle) > 0,
IsInVehicle = true,
VehIsEngineRunning = (packet.Flag.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0,
VehAreLightsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreLightsOn) > 0,
VehAreHighBeamsOn = (packet.Flag.Value & (byte)VehicleDataFlags.AreHighBeamsOn) > 0,

View File

@ -141,8 +141,7 @@ namespace CoopClient
IsReloading = 1 << 3,
IsJumping = 1 << 4,
IsRagdoll = 1 << 5,
IsOnFire = 1 << 6,
IsInVehicle = 1 << 7
IsOnFire = 1 << 6
}
#region ===== VEHICLE DATA =====
@ -150,12 +149,11 @@ namespace CoopClient
enum VehicleDataFlags
{
LastSyncWasFull = 1 << 0,
IsInVehicle = 1 << 1,
IsEngineRunning = 1 << 2,
AreLightsOn = 1 << 3,
AreHighBeamsOn = 1 << 4,
IsSirenActive = 1 << 5,
IsDead = 1 << 6
IsEngineRunning = 1 << 1,
AreLightsOn = 1 << 2,
AreHighBeamsOn = 1 << 3,
IsSirenActive = 1 << 4,
IsDead = 1 << 5
}
[ProtoContract]

View File

@ -175,9 +175,6 @@ namespace CoopClient
flags |= (byte)VehicleDataFlags.LastSyncWasFull;
}
// Ped is in vehicle
flags |= (byte)VehicleDataFlags.IsInVehicle;
if (veh.IsEngineRunning)
{
flags |= (byte)VehicleDataFlags.IsEngineRunning;
@ -245,11 +242,6 @@ namespace CoopClient
flags |= (byte)PedDataFlags.IsOnFire;
}
if (ped.IsInVehicle())
{
flags |= (byte)PedDataFlags.IsInVehicle;
}
return flags;
}

View File

@ -84,8 +84,7 @@ namespace CoopServer
IsReloading = 1 << 3,
IsJumping = 1 << 4,
IsRagdoll = 1 << 5,
IsOnFire = 1 << 6,
IsInVehicle = 1 << 7
IsOnFire = 1 << 6
}
#region ===== VEHICLE DATA =====
@ -93,12 +92,11 @@ namespace CoopServer
enum VehicleDataFlags
{
LastSyncWasFull = 1 << 0,
IsInVehicle = 1 << 1,
IsEngineRunning = 1 << 2,
AreLightsOn = 1 << 3,
AreHighBeamsOn = 1 << 4,
IsSirenActive = 1 << 5,
IsDead = 1 << 6
IsEngineRunning = 1 << 1,
AreLightsOn = 1 << 2,
AreHighBeamsOn = 1 << 3,
IsSirenActive = 1 << 4,
IsDead = 1 << 5
}
[ProtoContract]