Author Topic: 2 Flag Overtime Bug  (Read 9435 times)

coLa

  • Autococker
  • Posts: 1178
Re: 2 Flag Overtime Bug
« Reply #20 on: November 03, 2007, 08:01:23 PM »
how about you come over and i can show you how a real man loves another. :P i heard it was fixed MAH BAD. anyways. we still won. =\

lekky

  • Autococker
  • Posts: 2449
Re: 2 Flag Overtime Bug
« Reply #21 on: November 03, 2007, 08:17:36 PM »
I THOUGHT THIS BUG WAS FIXED? IT HAPPENED AGAIN A WHILE AGO. THIS TIME TO ME. WTF IS UP YO.

;D

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: 2 Flag Overtime Bug
« Reply #22 on: November 08, 2007, 01:07:38 AM »
I'm confused.  I took a look at the code to see if there was a quick fix:

Code: [Select]
void CheckForBonusPoints (void)
{
edict_t *flag = NULL;
qboolean needs_overtime;

needs_overtime = GameNeedsOvertime(); // 1.831

while ((flag = G_Find(flag, FOFS(classname), ITEM_SCORE_STRING)))
{
if (flag->teamnumber == 0)
continue;

// Flag must be owned, and belong to a team with no players.
if (flag->owner && (!GetLivingPlayersOnTeam(flag->teamnumber) || (GameIsGameOver() && !needs_overtime))) // 1.831
{
{
char LOGping[256];
char LOGtime[256];
strcpy(LOGtime, va("%i", (int)level.time));
strcpy(LOGping, va("%i", (int)flag->owner->client->ping));
PrintToLog(flag->owner->client->pers.netname, NULL, "FlagBONUS", NULL, "3", LOGtime, LOGping, 1);
}

safe_bprintf(PRINT_HIGH,"%c%s's %s earned 2 points for possesion of eliminated teams flag!\n",
splat(flag->owner->teamnumber),
TeamsGetName(TeamsGetTeam(flag->owner)),
flag->owner->client->pers.netname);

flag->owner->client->resp.flagretsscore += 2;
TeamsAdjustScore(TeamsGetTeam(flag->owner), 2);

if (!GameIsRoundOver()) // 1.80 - so flag doesn't show up at round end when someone is carrying it
{
DropCtfFlags(flag->owner, flag->teamnumber); // 1.80
MakeTouchable(flag); // Only make flag appear at base if there are other teams alive
}

flag->pickuptime = level.time;
flag->nextthink = 0;
flag->think = NULL;
flag->owner = NULL;
flag->nextdo = 0;
flag->pbitem = 1; // TODO Move this to SP function

if (flag->origin1[0] != 0 || flag->origin1[1] != 0 || flag->origin1[2] != 0)
{
VectorCopy(flag->origin1, flag->s.origin);
flag->s.event = EV_OTHER_TELEPORT;
}
}
}
}

I don't see how it's possible for somebody to get credit for just 1 flag.  It loops through all the flags before anything else ever happens in the game, unless you were playing on a server with the old version before I fixed the bug (it used to have GameNeedsOvertime() in the loop, I believe).  What server was this on, and what version was it running?

Playah

  • 68 Carbine
  • Posts: 485
Re: 2 Flag Overtime Bug
« Reply #23 on: November 08, 2007, 10:59:34 AM »
I wasn't playing but judging from the sreenshot it must've either been a GT Match or an eR33t match. All those servers have the same (150) version.

coLa

  • Autococker
  • Posts: 1178
Re: 2 Flag Overtime Bug
« Reply #24 on: November 08, 2007, 11:09:21 AM »
it was on an er33t server. not sure what version it was but i am sure bain can tell you. this is what happened. we were down by 2 points about 30sec left, playing pbcup_pforest, i grabbed both flags and i was hiding in backdoor waiting for the time to run out thinking i was going to get credit for both flags. as soon and the time struck 0 it gave me credit for one flag and made me drop the other and went into overtime. =\

Playah

  • 68 Carbine
  • Posts: 485
Re: 2 Flag Overtime Bug
« Reply #25 on: November 08, 2007, 02:48:07 PM »
Not that you missunderstand me jits: I was referring to the original match "mosez" reported.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: 2 Flag Overtime Bug
« Reply #26 on: November 08, 2007, 02:53:39 PM »
Hmm, looks like they're running the latest version.

Aha, I see what's going on now:

Code: [Select]

if (!GameIsRoundOver()) // 1.80 - so flag doesn't show up at round end when someone is carrying it
{
DropCtfFlags(flag->owner, flag->teamnumber); // 1.80
MakeTouchable(flag); // Only make flag appear at base if there are other teams alive
}

In 4-team mode, if a team is eliminated, whoever is carrying their flag is forced to drop it.  You can't capture the flag of an eliminated team.  It's just checking for round over, though, not game over.  Quick fix would be to check for game over, too, but this bug could resurface on a map with more than 2 teams and more than 1 flag per team.  I think making a function that just drops one flag would fix it.