Rune Central
http://forums.runecentral.com/

pqc error?
http://forums.runecentral.com/viewtopic.php?f=2&t=856
Page 1 of 1

Author:  sputnikutah [ Mon Aug 22, 2005 3:38 am ]
Post subject:  pqc error?

Code:
void (entity e, float tm, float tf)
pqc_team_frags =
{   
   local float msg_type;

   if (e == world)
      msg_type = MSG_ALL;
   else
   {
      msg_entity = e;
      msg_type = MSG_ONE;
   }

   WriteByte (msg_type, SVC_STUFFTEXT);
   WriteByte (msg_type, 1);
   WriteByte (msg_type, PQC_TEAM_FRAGS);
   WriteByte (msg_type, 15 + tm);   //team
   WriteShortPQ (msg_type, tf);   //frags
   WriteString (msg_type, string_null);
};

shouldnt this be
Code:
    WriteByte (msg_type, 16 + tm);   //team

16 not 15??

in the engine
Code:
   case pqc_team_frags:
      Sbar_Changed ();
      team = MSG_ReadByte() - 16;
      if (team < 0 || team > 13)
         Host_Error ("CL_ParseProQuakeMessage: pqc_team_frags invalid team");
      frags = MSG_ReadShortPQ();;
      if (frags & 32768)
         frags = frags - 65536;
      cl.teamscores[team].frags = frags;
      //Con_Printf("pqc_team_frags %d %d\n", team, frags);
      break;   

team = MSG_ReadByte() - 16;
same format as erase teams?

Author:  Slot Zero [ Mon Aug 22, 2005 10:07 pm ]
Post subject: 

When I was developing the functions, I originally wrote them to accept the value of the team field, which is color + 1. Rather than subtracting 1 from each argument every single time it was called, I modified the function instead.

It was just a matter of convenience at the time. I'll change this though to make it consistent with the other pqc functions.

Thanks!

Author:  sputnikutah [ Tue Aug 23, 2005 12:11 am ]
Post subject: 

Its not a bug in runequake, unless u modify the TEAM_1 & TEAM_2 values....
depends who is lookin ;P
I was just trying to find a bug in the engine and was lookin thru the mod source also...i found the bug, atleast in my engine... not the mod so its all good.
BTW, your work is an invaluable reference of "proper" quakeC coding!

:D

Author:  Slot Zero [ Sun Sep 11, 2005 4:00 pm ]
Post subject: 

I finally got around to changing this yesterday. I made some other minor changes to the pqc_* functions as well, like protecting against accidental crashing if you supply a non-client as the broadcast entity.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/