MonsterEvent switches state back to "not started" if the sub gets far enough from the monsters (prevents monster music from staying on), SoundPlayer plays a random default music clip if a suitable clip isn't found for the highest priority task

This commit is contained in:
Regalis
2017-03-19 20:34:21 +02:00
parent cd0da235a2
commit d6074d23ab
2 changed files with 40 additions and 30 deletions
+2 -1
View File
@@ -94,12 +94,13 @@ namespace Barotrauma
if (isFinished) return;
isStarted = false;
bool monstersDead = true;
foreach (Character monster in monsters)
{
if (monster.IsDead) continue;
if (!isStarted && Vector2.Distance(monster.WorldPosition, Submarine.MainSub.WorldPosition) < 5000.0f) isStarted = true;
if (!isStarted && Vector2.DistanceSquared(monster.WorldPosition, Submarine.MainSub.WorldPosition) < 5000.0f*5000.0f) isStarted = true;
monstersDead = false;
break;