Rune Central

The Official Rune Quake Message Board
It is currently Thu Mar 28, 2024 1:29 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: pqc error?
PostPosted: Mon Aug 22, 2005 3:38 am 
Offline
quake.intertex.net
User avatar

Joined: Sat Nov 15, 2003 7:39 pm
Posts: 243
Location: Kansas City!
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?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 22, 2005 10:07 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1255
Location: New Jersey, USA
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!

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 23, 2005 12:11 am 
Offline
quake.intertex.net
User avatar

Joined: Sat Nov 15, 2003 7:39 pm
Posts: 243
Location: Kansas City!
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 11, 2005 4:00 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1255
Location: New Jersey, USA
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.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group