Skip to content

Commit

Permalink
Fix being able to vote twice (visually)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMyWing committed Dec 11, 2020
1 parent d759b3e commit 5466378
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gamemodes/amongus/gamemode/vgui/vgui_meeting.moon
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ meeting.DisableAllButtons = =>

meeting.CanIVote = =>
localPlayer = LocalPlayer!
localPlayerTable = localPlayer\GetAUPlayerTable!

return @__currentState == STATES.ends and
IsValid(localPlayer) and
localPlayer\GetAUPlayerTable! and
not localPlayer\IsDead!
localPlayerTable and
not localPlayer\IsDead! and
not @__voted[localPlayerTable]

--- Purges all existing confirms.
meeting.PurgeConfirms = =>
Expand Down Expand Up @@ -1123,6 +1126,9 @@ meeting.ApplyVote = (playerTable, remaining) =>
@__chatButton\Bump!
@__chatOverlay\PushVote playerTable, remaining

if playerTable == LocalPlayer!\GetAUPlayerTable!
@PurgeConfirms!

if btn = @__voteItems[playerTable.id]
if playerTable.entity ~= LocalPlayer!
surface.PlaySound "au/notification.ogg"
Expand Down

0 comments on commit 5466378

Please sign in to comment.