Ejemplo n.º 1
0
        public override bool TrySpawn(ushort vehicleID, ref Vehicle vehicleData)
        {
            if ((vehicleData.m_flags & Vehicle.Flags.Spawned) != (Vehicle.Flags) 0)
            {
                // NON-STOCK CODE START
                if (Options.prioritySignsEnabled || Options.timedLightsEnabled)
                {
                    VehicleStateManager.Instance().OnVehicleSpawned(vehicleID, ref vehicleData);
                }
                // NON-STOCK CODE END

                return(true);
            }
            if (CustomCarAI.CheckOverlap(vehicleData.m_segment, 0, 1000f))
            {
                vehicleData.m_flags |= Vehicle.Flags.WaitingSpace;
                return(false);
            }
            vehicleData.Spawn(vehicleID);
            vehicleData.m_flags &= ~Vehicle.Flags.WaitingSpace;

            // NON-STOCK CODE START
            if (Options.prioritySignsEnabled || Options.timedLightsEnabled)
            {
                VehicleStateManager.Instance().OnVehicleSpawned(vehicleID, ref vehicleData);
            }
            // NON-STOCK CODE END

            return(true);
        }
 public override bool TrySpawn(ushort vehicleId, ref Vehicle vehicleData)
 {
     if ((vehicleData.m_flags & Vehicle.Flags.Spawned) != (Vehicle.Flags) 0)
     {
         return(true);
     }
     if (CustomCarAI.CheckOverlap(vehicleData.m_segment, 0, 1000f))
     {
         vehicleData.m_flags |= Vehicle.Flags.WaitingSpace;
         return(false);
     }
     vehicleData.Spawn(vehicleId);
     vehicleData.m_flags &= ~Vehicle.Flags.WaitingSpace;
     return(true);
 }