Beispiel #1
0
        private void CheckAndAddOwnerId(VehicleEntity vehicle, PlayerEntity playerEntity)
        {
            var ownerId = playerEntity.entityKey.Value;

            if (playerEntity.IsVehicleDriver())
            {
                if (vehicle.hasOwnerId)
                {
                    if (vehicle.ownerId.Value == ownerId)
                    {
                        return;
                    }

                    vehicle.RemoveOwnerId();
                }

                vehicle.AddOwnerId(ownerId);
            }
        }