Incorrect failure bracketing style

So I have this snippet:

var MaybeTeam : ?team = option{GetPlayspace().GetTeamCollection().GetTeams()[0]}

        if (ValidTeam := MaybeTeam?):
            for (Player : GetPlayspace().GetPlayers()):
                MaybeFortCharacter : ?fort_character = option{Player.GetFortCharacter[]}
                    if (ValidFortCharacter := MaybeFortCharacter?):
                        MaybeAgent : ?agent = option{ValidFortCharacter.GetAgent[]}
                        if (ValidAgent := MaybeAgent?):
                            if (GetPlayspace().GetTeamCollection().IsOnTeam(ValidAgent, ValidTeam)): #this line throws error
                                ScoreManager.Activate(ValidAgent)

And I’m getting "Function is invoked with incorrect failure bracketing style." error on the last “if”. I don’t get it. I know it implements but I have already nested it inside “if” statement so shouldn’t that solve the failure handling?

Solved it myself. Instead of round brackets I need to use square brackets in the IsOnTeam call because it is failable…

if (GetPlayspace().GetTeamCollection().IsOnTeam[ValidAgent, ValidTeam]): #now it works

Starting to hate Verse with passion

1 Like