Skip to content

Commit 9ec2fe2

Browse files
Reverting bug introduced in #4071 (#4101)
1 parent 0744822 commit 9ec2fe2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

com.unity.ml-agents/Runtime/Academy.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,6 @@ void InitializeEnvironment()
366366
port = port
367367
}
368368
);
369-
Communicator.QuitCommandReceived += OnQuitCommandReceived;
370-
Communicator.ResetCommandReceived += OnResetCommand;
371369
}
372370

373371
if (Communicator != null)
@@ -400,6 +398,11 @@ void InitializeEnvironment()
400398
Communicator = null;
401399
}
402400
}
401+
if (Communicator != null)
402+
{
403+
Communicator.QuitCommandReceived += OnQuitCommandReceived;
404+
Communicator.ResetCommandReceived += OnResetCommand;
405+
}
403406

404407
// If a communicator is enabled/provided, then we assume we are in
405408
// training mode. In the absence of a communicator, we assume we are

0 commit comments

Comments
 (0)