Difference for main/multi.c from version 1.10 to 1.11


version 1.10 version 1.11
Line 146
 
Line 146
   
 short remote_to_local[MAX_NUM_NET_PLAYERS][MAX_OBJECTS];  // Remote object number for each local object  short remote_to_local[MAX_NUM_NET_PLAYERS][MAX_OBJECTS];  // Remote object number for each local object
 short local_to_remote[MAX_OBJECTS];   short local_to_remote[MAX_OBJECTS];
 byte  object_owner[MAX_OBJECTS];   // Who created each object in my universe, -1 = loaded at start  sbyte  object_owner[MAX_OBJECTS];   // Who created each object in my universe, -1 = loaded at start
   
 int Net_create_objnums[MAX_NET_CREATE_OBJECTS]; // For tracking object creation that will be sent to remote  int Net_create_objnums[MAX_NET_CREATE_OBJECTS]; // For tracking object creation that will be sent to remote
 int Net_create_loc = 0;  // pointer into previous array  int Net_create_loc = 0;  // pointer into previous array
Line 412
 
Line 412
  return(result);   return(result);
 }  }
   
 int objnum_local_to_remote(int local_objnum, byte *owner)  int objnum_local_to_remote(int local_objnum, sbyte *owner)
 {  {
  // Map a local object number to a remote + owner   // Map a local object number to a remote + owner
   
Line 1714
 
Line 1714
 {  {
  ubyte weapon;   ubyte weapon;
  int pnum;   int pnum;
  byte flags;   sbyte flags;
  fix save_charge = Fusion_charge;   fix save_charge = Fusion_charge;
          
  // Act out the actual shooting   // Act out the actual shooting
Line 2160
 
Line 2160
  killed = Players[pnum].objnum;    killed = Players[pnum].objnum;
  count += 1;   count += 1;
 #else  #else
  killed = objnum_remote_to_local(*(short *)(buf+count), (byte)buf[count+2]);   killed = objnum_remote_to_local(*(short *)(buf+count), (sbyte)buf[count+2]);
  count += 3;   count += 3;
 #endif  #endif
  killer = *(short *)(buf+count);    killer = *(short *)(buf+count);
  if (killer > 0)   if (killer > 0)
  killer = objnum_remote_to_local(killer, (byte)buf[count+2]);   killer = objnum_remote_to_local(killer, (sbyte)buf[count+2]);
   
 #ifdef SHAREWARE  #ifdef SHAREWARE
  if ((Objects[killed].type != OBJ_PLAYER) && (Objects[killed].type != OBJ_GHOST))   if ((Objects[killed].type != OBJ_PLAYER) && (Objects[killed].type != OBJ_GHOST))
Line 2185
 
Line 2185
 // which means not a controlcen object, but contained in another object  // which means not a controlcen object, but contained in another object
 void multi_do_controlcen_destroy(char *buf)  void multi_do_controlcen_destroy(char *buf)
 {  {
  byte who;   sbyte who;
  short objnum;   short objnum;
   
  objnum = *(short *)(buf+1);   objnum = *(short *)(buf+1);
Line 2248
 
Line 2248
 {  {
  short objnum; // which object to remove   short objnum; // which object to remove
  short local_objnum;   short local_objnum;
  byte obj_owner; // which remote list is it entered in   sbyte obj_owner; // which remote list is it entered in
   
  objnum = *(short *)(buf+1);   objnum = *(short *)(buf+1);
  obj_owner = buf[3];   obj_owner = buf[3];
Line 3232
 
Line 3232
 #ifndef SHAREWARE  #ifndef SHAREWARE
  multibuf[1] = Player_num; count += 1;   multibuf[1] = Player_num; count += 1;
 #else  #else
  *(short *)(multibuf+count) = (short)objnum_local_to_remote(objnum, (byte *)&multibuf[count+2]);   *(short *)(multibuf+count) = (short)objnum_local_to_remote(objnum, (sbyte *)&multibuf[count+2]);
  count += 3;   count += 3;
 #endif  #endif
   
  Assert(Objects[objnum].id == Player_num);   Assert(Objects[objnum].id == Player_num);
  killer_objnum = Players[Player_num].killer_objnum;   killer_objnum = Players[Player_num].killer_objnum;
  if (killer_objnum > -1)   if (killer_objnum > -1)
  *(short *)(multibuf+count) = (short)objnum_local_to_remote(killer_objnum, (byte *)&multibuf[count+2]);   *(short *)(multibuf+count) = (short)objnum_local_to_remote(killer_objnum, (sbyte *)&multibuf[count+2]);
  else   else
  {   {
  *(short *)(multibuf+count) = -1;   *(short *)(multibuf+count) = -1;
Line 3261
 
Line 3261
 {  {
  // Tell the other guy to remove an object from his list   // Tell the other guy to remove an object from his list
   
  byte obj_owner;   sbyte obj_owner;
  short remote_objnum;   short remote_objnum;
   
  multibuf[0] = (char)MULTI_REMOVE_OBJECT;   multibuf[0] = (char)MULTI_REMOVE_OBJECT;
Line 3339
 
Line 3339
  multi_send_data(multibuf, 7, 1);   multi_send_data(multibuf, 7, 1);
 #else  #else
  *(short *)(multibuf+1) = (short)segnum;   *(short *)(multibuf+1) = (short)segnum;
  multibuf[3] = (byte)side;   multibuf[3] = (sbyte)side;
  multi_send_data(multibuf, 4, 1);   multi_send_data(multibuf, 4, 1);
 #endif  #endif
   
Line 3359
 
Line 3359
  int count = 0;   int count = 0;
   
  multibuf[count] = MULTI_CREATE_EXPLOSION; count += 1;   multibuf[count] = MULTI_CREATE_EXPLOSION; count += 1;
  multibuf[count] = (byte)pnum; count += 1;   multibuf[count] = (sbyte)pnum; count += 1;
  // -----------   // -----------
  // Total size = 2   // Total size = 2
   

Legend:
line(s) removed in v.1.10 
line(s) changed
 line(s) added in v.1.11