Different, nicer way of doing fakeouts

Means it can no longer cheat, but I never saw it cheat in action anyway.
This commit is contained in:
TehRealSalt 2018-06-13 21:47:27 -04:00
parent c818689dc1
commit 5f4c0bb052

View file

@ -2403,13 +2403,17 @@ void Y_VoteTicker(void)
{ {
if (voteclient.rendoff == 0) if (voteclient.rendoff == 0)
{ {
if ((tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote // Pick normally if (voteclient.rsynctime % 51 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V)
|| 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)
{ {
voteclient.rendoff = voteclient.roffset+4; for (i = 5; i >= 3; i--) // Find a suitable place to stop
S_ChangeMusicInternal("voteeb", false); {
if (tempvotes[((pickedvote + voteclient.roffset + i) % numvotes)] == pickedvote)
{
voteclient.rendoff = voteclient.roffset+i;
S_ChangeMusicInternal("voteeb", false);
break;
}
}
} }
} }
else if (voteclient.roffset >= voteclient.rendoff) else if (voteclient.roffset >= voteclient.rendoff)