private static void PlayGroup(int startId, int endId, ref ISound instance, Vehicle vehicle) { if (instance != null && instance.IsPlaying && instance.Owner != vehicle) { if (vehicle.Driver is PlayerDriver) //priority { instance.Reset(); } else if (((Vehicle)instance.Owner).Driver is PlayerDriver) { return; //dont steal player's sound } } if (instance == null || !instance.IsPlaying) { int id = Engine.Random.Next(startId, endId + 1); instance = Play(id, vehicle, true); } }
private static void PlayGroup(int startId, int endId, ref ISound instance, Vehicle vehicle) { if (instance != null && instance.IsPlaying && instance.Owner != vehicle) { if (vehicle.Driver is PlayerDriver) //priority instance.Reset(); else if (((Vehicle)instance.Owner).Driver is PlayerDriver) { return; //dont steal player's sound } } if (instance == null || !instance.IsPlaying) { int id = Engine.Random.Next(startId, endId+1); instance = Play(id, vehicle, true); } }