Raptor007/aq2-tng

CTF matchmode bug

Closed this issue · 5 comments

m4son commented

After CTF match is finished in a matchmode, if we ready up again, it doesn't switch teams after half the timelimit. But if we do resetscores it's as it should be.

Interesting. Probably related to issue #80. At a quick glance, I suspect it needs teams_changed = false when the match ends.

I tried to recreate this problem with ctf 1 matchmode 1 but was unable to. Whether the map was changed by votemap, gamemap, or map, the teams still swap correctly at every halftime. I also tried with both auto_join 0 and auto_join 1. The only quirk is that with auto_join 1, the teams you are swapped to at halftime become your starting teams for the next map. But they do correctly swap back at halftime, so this isn't really a problem.

I also looked into the teams_changed variable. It's just used to update the join menu, and will get changed to false in ClientEndServerFrames on the next FRAMESYNC:

aq2-tng/source/g_main.c

Lines 602 to 609 in 7fcea7d

if( teams_changed && FRAMESYNC )
{
updateLayout = 1;
teams_changed = false;
UpdateJoinMenu();
}
else if( !(level.realFramenum % (3 * HZ)) )
updateLayout = 1;

Let me know if you are still having this problem. Maybe some other code cleanup fixed this accidentally.

m4son commented

We did not change the map, just ready up again. Going to try again.

Ah thanks, now I understand. I'll try again.

m4son commented

Ops, I forgot to test but it seems like you found the problem too!