From 5f4c0bb05240f76ed3688fc8cd0683a2769893f2 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 21:47:27 -0400 Subject: [PATCH] Different, nicer way of doing fakeouts Means it can no longer cheat, but I never saw it cheat in action anyway. --- src/y_inter.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 5f17c16e..d8291933 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2403,13 +2403,17 @@ void Y_VoteTicker(void) { if (voteclient.rendoff == 0) { - if ((tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote // Pick normally - || tempvotes[((pickedvote + voteclient.roffset + 3) % numvotes)] == pickedvote // Fake out: land early - || tempvotes[((pickedvote + voteclient.roffset + 2) % numvotes)] == pickedvote) // Fake out: cheat and move - && voteclient.rsynctime % 51 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) + if (voteclient.rsynctime % 51 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) { - voteclient.rendoff = voteclient.roffset+4; - S_ChangeMusicInternal("voteeb", false); + for (i = 5; i >= 3; i--) // Find a suitable place to stop + { + if (tempvotes[((pickedvote + voteclient.roffset + i) % numvotes)] == pickedvote) + { + voteclient.rendoff = voteclient.roffset+i; + S_ChangeMusicInternal("voteeb", false); + break; + } + } } } else if (voteclient.roffset >= voteclient.rendoff)