]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
vstop: clarify chatcon messages 1499/head
authorbones_was_here <bones_was_here@xonotic.au>
Fri, 2 May 2025 19:55:27 +0000 (05:55 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 3 May 2025 08:25:16 +0000 (18:25 +1000)
Distinguishes between self-stopped and cancelled by code such as
NextLevel().

qcsrc/server/command/vote.qc

index 8ec7e9f6d64a56f81b69f2d6310dba6778a45d9c..799ce159482b25eb7a7b345ae253fc39df757f76 100644 (file)
@@ -155,10 +155,13 @@ void VoteReset(bool verbose)
 
 void VoteStop(entity stopper, bool canceled)
 {
-       if (canceled)
+       if (canceled) // Code such as NextLevel() stopped it, not a direct action by a human.
                bprint("\{1}^2* ^3", OriginalCallerName(), "^2's vote was canceled\n");
+       else if (stopper == vote_caller)
+               bprint("\{1}^2* ^3", OriginalCallerName(), "^2 stopped their vote\n");
        else
                bprint("\{1}^2* ^3", GetCallerName(stopper), "^2 stopped ^3", OriginalCallerName(), "^2's vote\n");
+
        if (autocvar_sv_eventlog)   GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid)));
        // Don't force them to wait for next vote, this way they can e.g. correct their vote.
        if ((vote_caller) && (stopper == vote_caller))   vote_caller.vote_waittime = time + autocvar_sv_vote_stop;
@@ -1202,7 +1205,7 @@ void VoteCommand_no(int request, entity caller)  // CLIENT ONLY
                        }
                        else if (caller == vote_caller && autocvar_sv_vote_no_stops_vote)
                        {
-                               VoteStop(caller, true);
+                               VoteStop(caller, false);
                        }
 
                        else  // everything went okay, continue changing vote