All pastes #511124 Raw Edit

Unnamed

public c v1 · immutable
#511124 ·published 2007-05-26 08:00 UTC
rendered paste body
Index: src/client/cl_basemanagement.c===================================================================--- src/client/cl_basemanagement.c      (Revision 8765)+++ src/client/cl_basemanagement.c      (Arbeitskopie)@@ -2824,9 +2824,15 @@                        MSG_WritePos(sb, aircraft->pos);                        MSG_WriteShort(sb, aircraft->time);                        MSG_WriteShort(sb, aircraft->point);-                       MSG_WriteString(sb, aircraft->weapon_string);-                       MSG_WriteString(sb, aircraft->shield_string);-                       MSG_WriteString(sb, aircraft->item_string);++                       /* save weapon slots */+                       MSG_WriteShort(sb, TODO GET ITEM AMOUNT);+                       for (l = 0; l < MAX_AIRCRAFTSLOT; l++) {+                               if (aircraft->weapons[l].itemIdx >= 0)+                                       MSG_WriteString(sb, aircraftItems[aircraft->weapons[l].itemIdx].id);+                       }+                       /* TODO: The same for shield and items */+                        for (l = 0; l < MAX_ACTIVETEAM; l++)                                MSG_WriteShort(sb, aircraft->teamIdxs[l]);                        MSG_WriteShort(sb, aircraft->numUpgrades);@@ -2994,9 +3000,18 @@                        MSG_ReadPos(sb, aircraft->pos);                        aircraft->time = MSG_ReadShort(sb);                        aircraft->point = MSG_ReadShort(sb);-                       Q_strncpyz(aircraft->weapon_string, MSG_ReadString(sb), sizeof(aircraft->weapon_string));-                       Q_strncpyz(aircraft->shield_string, MSG_ReadString(sb), sizeof(aircraft->shield_string));-                       Q_strncpyz(aircraft->item_string, MSG_ReadString(sb), sizeof(aircraft->item_string));+                       if (*(int*)data == 1) { /* >= 2.1.1 */+                               MSG_ReadString(sb);     /* old weapon string */+                               MSG_ReadString(sb);     /* old shield string */+                               MSG_ReadString(sb);     /* old item string */+                       } else {+                               /* read weapon slot */+                               amount = MSG_ReadShort(sb);+                               for (l = 0; l < amount; l++) {+                                       /* TODO: fill the slot with the given item */+                               }+                               /* TODO read shield and item slots */+                       }                        for (l = 0; l < MAX_ACTIVETEAM; l++)                                aircraft->teamIdxs[l] = MSG_ReadShort(sb);                        aircraft->numUpgrades = MSG_ReadShort(sb);