Raptor007 / aq2-tng

Action Quake 2: The Next Generation. Raptor007's sandbox for testing changes. When verified stable, this code is pushed to the official aq2-tng repo:
https://github.com/aq2-tng/aq2-tng/tree/bots
4 stars 2 forks source link

CTF matchmode bug #105

Closed m4son closed 2 years ago

m4son commented 2 years ago

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.

Raptor007 commented 2 years ago

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

Raptor007 commented 2 years ago

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: https://github.com/Raptor007/aq2-tng/blob/7fcea7db86db9087bd9217f50db31ca9bdbb7792/source/g_main.c#L602-L609

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

m4son commented 2 years ago

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

Raptor007 commented 2 years ago

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

m4son commented 2 years ago

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