NeunEinser / bingo

A custom item fetch gamemode for Minecraft
MIT License
84 stars 16 forks source link

"points race" mode is not selecting the winner correctly? (5.1.2-pre1) #223

Closed davepusey closed 5 months ago

davepusey commented 6 months ago

(5.1.2-pre1 on 1.20.4)

Twice during Phedran's stream today we used the "points race" mode, and both times it announced the wrong winner?

image

image

davepusey commented 6 months ago

And for completeness, it was 3 teams of 1 player each.

Screenshots are from my own POV recording. I was on Orange team.

davepusey commented 6 months ago

Game today with 5 teams of 1 player each.

Second place was announced as the winner.

I wonder if this is an off-by-1 error, like referencing [1] instead of [0] somewhere.

image

davepusey commented 6 months ago

Second game got it right lol

image

NeunEinser commented 6 months ago

Yeah, im pretty sure it's arbitrary. fetchr:item_detection/goals/points/find_winners is supposed to iterate over a temporary copy of the teams array, but in the calling function that temporary array is never actually copied/created.

So, I think it just grabs some garbage data from whatever team happens to have been operated on last.

I haven't had time to check if this fixes it, and it doesn't happen in singleplayer, but I think I might have ways to reproduce it still.

davepusey commented 5 months ago

Will test and provide feedback, pending next hosted multiplayer session with Phedran and her patrons.

davepusey commented 5 months ago

Three more rounds tonight with Phedran's patrons. Correct winner(s) selected every time. I consider this fixed.