summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/politics.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt
index 0b02aa0c5..d4c939570 100644
--- a/npc/functions/politics.txt
+++ b/npc/functions/politics.txt
@@ -206,9 +206,16 @@ function script POL_Candidate {
if (.@vote < 0)
return;
+ // You cannot vote on yourself
+ .@str$="$"+getarg(0)+"_VOTES"+"["+.@vote+"]";
+ if (getd(.@str$) == strcharinfo(0)) {
+ mesc l("You cannot vote on yourself!"), 1;
+ // mesc l("Use an alt char to do that.");
+ return;
+ }
+
// Cast the vote
#POL_VOTEDAY=gettimeparam(GETTIME_DAYOFMONTH);
- .@str$="$"+getarg(0)+"_VOTES"+"["+.@vote+"]";
.@vt=getd(.@str$);
setd(.@str$, .@vt+1);