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

View File

@@ -3,14 +3,7 @@
class ScriptedTask : Task
{
private ScriptedEvent scriptedEvent;
private bool prevStarted;
public override bool IsStarted
{
get { return scriptedEvent.IsStarted; }
}
public ScriptedTask(ScriptedEvent scriptedEvent)
: base(scriptedEvent.Difficulty, scriptedEvent.Name)
{
@@ -24,12 +17,6 @@
public override void Update(float deltaTime)
{
if (prevStarted == false && scriptedEvent.IsStarted)
{
taskManager.TaskStarted(this);
prevStarted = true;
}
scriptedEvent.Update(deltaTime);
if (scriptedEvent.IsFinished) Finished();
}