Map vote changes to the wrong map
Describe the bug When a map vote is cancelled manually during the vote by an admin. If another map vote is called and passed, the map will first change to the map of the passed vote, then to the map of the cancelled vote.
To Reproduce Steps to reproduce the behavior:
- Start a vote for map A
- Admin cancels the vote using !cancelvote
- Start another vote for map B and passes
- Map changes to B then instantly changes to A
Expected behavior Server should not change to the map of the cancelled vote.
Game Server
- Sourcemod version: 1.11.6934
- Metamod version: 1.11.1148
- Custom Votes plugin version: 1.19.4U
- Game: Team Fortress 2
Additional context Not sure if the same can happen for other types of vote.
I could not reproduce this issue on my server. The server did not change to map A after changing to map B.
L 07/11/2023 - 10:24:52: [Custom Votes] Vote Change the map started by Anonymous Player ( - ). To change map from mvm_coaltown to mvm_bigrock.
L 07/11/2023 - 10:25:22: [Custom Votes] Vote Change the map started by Anonymous Player ( - ). To change map from mvm_coaltown to mvm_decoy.
L 07/11/2023 - 10:25:24: [Custom Votes] Last vote ( Change the map ) passed. Map was changed from mvm_coaltown to mvm_decoy.
Please test again on a clean sourcemod install with only core plugins and this plugin.
When the map vote recieved votes less than the passing ratio, the cancelvote works as expected:
L 07/11/2023 - 21:34:51: [Custom Votes] Vote Change map started by 国服第一毛茸茸爱好者 ( STEAM_0:1:43503746 ). To change map from cp_process_f12 to cp_gullywash_f7.
L 07/11/2023 - 21:34:58: "国服第一毛茸茸爱好者<3><[U:1:87007493]><Red>" say "!cancelvote"
L 07/11/2023 - 21:35:15: [Custom Votes] Vote Change map started by 国服第一毛茸茸爱好者 ( STEAM_0:1:43503746 ). To change map from cp_process_f12 to koth_product_final.
L 07/11/2023 - 21:35:17: [Custom Votes] Last vote ( Change map ) passed. Map was changed from cp_process_f12 to koth_product_final.
L 07/11/2023 - 21:35:17: [basecommands.smx] "Console<0><Console><Console>" changed map to "koth_product_final"
L 07/11/2023 - 21:35:20: [SM] Changed map to "koth_product_final"
When it already recieved votes greater than the passing ratio while some players haven't voted, the cancelvote doesn't work properly:
L 07/11/2023 - 21:36:30: [Custom Votes] Vote Change map started by 国服第一毛茸茸爱好者 ( STEAM_0:1:43503746 ). To change map from koth_product_final to cp_gullywash_f9.
L 07/11/2023 - 21:36:33: "国服第一毛茸茸爱好者<3><[U:1:87007493]><Red>" say "!cancelvote"
L 07/11/2023 - 21:36:44: [Custom Votes] Vote Change map started by 国服第一毛茸茸爱好者 ( STEAM_0:1:43503746 ). To change map from koth_product_final to cp_process_f12.
L 07/11/2023 - 21:36:46: [Custom Votes] Last vote ( Change map ) passed. Map was changed from koth_product_final to cp_process_f12.
L 07/11/2023 - 21:36:46: [basecommands.smx] "Console<0><Console><Console>" changed map to "cp_process_f12"
L 07/11/2023 - 21:36:49: [SM] Changed map to "cp_process_f12"
L 07/11/2023 - 21:36:49: [Custom Votes] Last vote ( Change map ) passed. Map was changed from koth_product_final to cp_gullywash_f9.
L 07/11/2023 - 21:36:55: [basecommands.smx] "Console<0><Console><Console>" changed map to "cp_gullywash_f9"
L 07/11/2023 - 21:36:58: [SM] Changed map to "cp_gullywash_f9"
See if the issue still occurs on this version. cvreduxmodified_dev.zip
It still occurs unfortunately.
Another behavior I observed: When a list vote received votes exceeding the passing ratio, while some players haven't voted. If the vote is cancelled manually, the options of the list vote are reordered.
To Reproduce Steps to reproduce the behavior:
- Start a vote for Option 5 in the list
- The vote exceeds the passing ratio, while some players haven't voted (AFK)
- Admin cancels the vote using !cancelvote
- Option 5 is now Option 1 in the list vote.
Suggested Fix: If a vote recieved votes exceeding passing ratio, it shouldn't wait for players that haven't voted. This would prevent admins from canceling the vote thus breaking the plugin.
Test this version please. cvreduxmodified_dev2.zip
Test this version please. cvreduxmodified_dev2.zip
This fixed the map vote. The list vote behavior persists.
Test this version please. cvreduxmodified_dev2.zip
This fixed the map vote. The list vote behavior persists.
Different issue, moved to #33