Commit dc4168e3 authored by Andreas Bigger's avatar Andreas Bigger

Small agent touchup following Adrian's pr.

parent 3c0e8a98
......@@ -55,16 +55,15 @@ func (a *Agent) Act(ctx context.Context) error {
// tryResolve resolves the game if it is in a terminal state
// and returns true if the game resolves successfully.
func (a *Agent) tryResolve(ctx context.Context) bool {
if a.responder.CanResolve(ctx) {
if !a.responder.CanResolve(ctx) {
return false
}
a.log.Info("Resolving game")
err := a.responder.Resolve(ctx)
if err != nil {
if err := a.responder.Resolve(ctx); err != nil {
a.log.Error("Failed to resolve the game", "err", err)
return false
}
return true
}
return false
}
// newGameFromContracts initializes a new game state from the state in the contract
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment