In one case the score is updated if it is less than CurrentGameMode.TeamScores[team], in the other it is updated if it is greater. This seems to have very different behavior.
Yeah, but unless I'm misreading the ternary or something, the logic in the OP is if the game mode is score based, only update the score if it is less than, and if it is not score based, then only update the score if it is greater than. Your code always returns early if the mode is not score based, and if it is, it always updates the score if it differs. I mean, for all I know, your version is how it should work, but this would be why I didn't see how != helps.
View all comments
Show parent comment
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Mar 10 '26
In one case the score is updated if it is less than
CurrentGameMode.TeamScores[team], in the other it is updated if it is greater. This seems to have very different behavior.