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
+4 -3
View File
@@ -29,9 +29,11 @@ namespace Barotrauma
DebugConsole.ThrowError("Error in SalvageMission: couldn't find an item prefab with the name "+itemName);
}
}
protected override void Start()
public override void Init()
{
base.Init();
Vector2 position = Level.Loaded.GetRandomItemPos(
Level.PositionType.Cave | Level.PositionType.MainPath | Level.PositionType.Ruin, 500.0f, 30.0f);
@@ -60,7 +62,6 @@ namespace Barotrauma
switch (state)
{
case 0:
Start();
state = 1;
break;
case 1: