cvreduxmodified icon indicating copy to clipboard operation
cvreduxmodified copied to clipboard

Map vote changes to the wrong map

Open aqua-hopps opened this issue 2 years ago • 10 comments

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:

  1. Start a vote for map A
  2. Admin cancels the vote using !cancelvote
  3. Start another vote for map B and passes
  4. 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.

aqua-hopps avatar Jul 11 '23 04:07 aqua-hopps

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.

caxanga334 avatar Jul 11 '23 13:07 caxanga334

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"

aqua-hopps avatar Jul 11 '23 21:07 aqua-hopps

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"

aqua-hopps avatar Jul 11 '23 22:07 aqua-hopps

See if the issue still occurs on this version. cvreduxmodified_dev.zip

caxanga334 avatar Jul 11 '23 23:07 caxanga334

It still occurs unfortunately.

aqua-hopps avatar Jul 11 '23 23:07 aqua-hopps

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:

  1. Start a vote for Option 5 in the list
  2. The vote exceeds the passing ratio, while some players haven't voted (AFK)
  3. Admin cancels the vote using !cancelvote
  4. Option 5 is now Option 1 in the list vote.

aqua-hopps avatar Jul 12 '23 00:07 aqua-hopps

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.

aqua-hopps avatar Jul 12 '23 00:07 aqua-hopps

Test this version please. cvreduxmodified_dev2.zip

caxanga334 avatar Jul 12 '23 00:07 caxanga334

Test this version please. cvreduxmodified_dev2.zip

This fixed the map vote. The list vote behavior persists.

aqua-hopps avatar Jul 12 '23 01:07 aqua-hopps

Test this version please. cvreduxmodified_dev2.zip

This fixed the map vote. The list vote behavior persists.

Different issue, moved to #33

caxanga334 avatar Jul 12 '23 02:07 caxanga334