caxanga334 / cvreduxmodified

Modified version of ReFlexPoison's custom votes
GNU General Public License v3.0
15 stars 9 forks source link

Map vote changes to the wrong map #32

Open aqua-hopps opened 1 year ago

aqua-hopps commented 1 year ago

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

Additional context Not sure if the same can happen for other types of vote.

caxanga334 commented 1 year ago

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.

aqua-hopps commented 1 year ago

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 commented 1 year ago

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"
caxanga334 commented 1 year ago

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

aqua-hopps commented 1 year ago

It still occurs unfortunately.

aqua-hopps commented 1 year ago

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 commented 1 year ago

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.

caxanga334 commented 1 year ago

Test this version please. cvreduxmodified_dev2.zip

aqua-hopps commented 1 year ago

Test this version please. cvreduxmodified_dev2.zip

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

caxanga334 commented 1 year ago

Test this version please. cvreduxmodified_dev2.zip

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

Different issue, moved to #33