MonsterEvents and ArtifactEvents spawn the monsters/items during initialization instead of waiting for the round to start (prevents entity ID mismatches if a client starts the event before receiving a message about something the server has spawned)

This commit is contained in:
Regalis
2017-01-01 23:14:24 +02:00
parent 1bba276949
commit e358ea9917
7 changed files with 10 additions and 105 deletions
+3 -7
View File
@@ -54,8 +54,10 @@ namespace Barotrauma
}
}
protected override void Start()
public override void Init()
{
base.Init();
SpawnMonsters();
}
@@ -88,10 +90,6 @@ namespace Barotrauma
}
if (monsters == null) SpawnMonsters();
//base.Update(deltaTime);
//if (!isStarted) return;
if (isFinished) return;
bool monstersDead = true;
@@ -99,8 +97,6 @@ namespace Barotrauma
{
if (monster.IsDead) continue;
if (!isStarted && Vector2.Distance(monster.WorldPosition, Submarine.MainSub.WorldPosition) < 5000.0f) isStarted = true;
monstersDead = false;
break;
}