@@ -510,67 +510,74 @@ static void SetStat(mvd_info_t *mvd, int stat, int value)
510
510
cp -> stats [stat ] = value ;
511
511
}
512
512
513
- static void NetMsg_Parser_ParsePacketEntities ( mvd_info_t * mvd , qbool delta )
513
+ static void NetMsg_Parser_ParseEntityNum ( unsigned int * entnum , unsigned int * bits , unsigned int * morebits )
514
514
{
515
- byte from ;
516
- int bits ;
515
+ * entnum = * bits = * morebits = 0 ;
517
516
518
- if (delta )
519
- {
520
- from = MSG_ReadByte ();
517
+ * bits = MSG_ReadShort ();
521
518
522
- if ((outgoing_sequence - incoming_sequence - 1 ) >= UPDATE_MASK )
523
- {
524
- return ;
525
- }
526
- }
519
+ * entnum = * bits & 0x1FF ;
520
+ * bits &= ~0x1FF ;
527
521
528
- while (true )
522
+ if ( * bits & U_MOREBITS )
529
523
{
530
- bits = MSG_ReadShort ();
531
-
532
- if (msg_badread )
524
+ * bits |= MSG_ReadByte ();
525
+ if (* bits & U_FTE_EVENMORE )
533
526
{
534
- // Something didn't parse right...
535
- Sys_PrintError ("NetMsg_Parser_ParsePacketEntities: msg_badread in packetentities.\n" );
536
- return ;
537
- }
527
+ * morebits = MSG_ReadByte ();
528
+ if (* morebits & U_FTE_YETMORE )
529
+ {
530
+ * morebits |= MSG_ReadByte () << 8 ;
531
+ }
538
532
539
- if (!bits )
540
- {
541
- break ;
533
+ if (* morebits & U_FTE_ENTITYDBL )
534
+ {
535
+ * entnum += 512 ;
536
+ }
537
+ if (* morebits & U_FTE_ENTITYDBL2 )
538
+ {
539
+ * entnum += 1024 ;
540
+ }
542
541
}
542
+ }
543
+ }
543
544
544
- bits &= ~0x1FF ; // Strip the first 9 bits.
545
+ static void NetMsg_Parser_ParseEntityDelta (unsigned int bits , unsigned int morebits )
546
+ {
547
+ if (bits & U_MODEL )
548
+ MSG_ReadByte ();
549
+ else if (morebits & U_FTE_MODELDBL )
550
+ MSG_ReadShort ();
545
551
546
- // Read any more bits.
547
- if (bits & U_MOREBITS )
548
- {
549
- bits |= MSG_ReadByte ();
550
- }
552
+ if (bits & U_FRAME )
553
+ MSG_ReadByte ();
554
+ if (bits & U_COLORMAP )
555
+ MSG_ReadByte ();
556
+ if (bits & U_SKIN )
557
+ MSG_ReadByte ();
558
+ if (bits & U_EFFECTS )
559
+ MSG_ReadByte ();
560
+ if (bits & U_ORIGIN1 )
561
+ MSG_ReadCoord ();
562
+ if (bits & U_ORIGIN2 )
563
+ MSG_ReadCoord ();
564
+ if (bits & U_ORIGIN3 )
565
+ MSG_ReadCoord ();
566
+ if (bits & U_ANGLE1 )
567
+ MSG_ReadAngle ();
568
+ if (bits & U_ANGLE2 )
569
+ MSG_ReadAngle ();
570
+ if (bits & U_ANGLE3 )
571
+ MSG_ReadAngle ();
551
572
552
- if (bits & U_MODEL )
553
- MSG_ReadByte ();
554
- if (bits & U_FRAME )
555
- MSG_ReadByte ();
556
- if (bits & U_COLORMAP )
557
- MSG_ReadByte ();
558
- if (bits & U_SKIN )
559
- MSG_ReadByte ();
560
- if (bits & U_EFFECTS )
561
- MSG_ReadByte ();
562
- if (bits & U_ORIGIN1 )
563
- MSG_ReadCoord ();
564
- if (bits & U_ORIGIN2 )
565
- MSG_ReadCoord ();
566
- if (bits & U_ORIGIN3 )
567
- MSG_ReadCoord ();
568
- if (bits & U_ANGLE1 )
569
- MSG_ReadAngle ();
570
- if (bits & U_ANGLE2 )
571
- MSG_ReadAngle ();
572
- if (bits & U_ANGLE3 )
573
- MSG_ReadAngle ();
573
+ if (morebits & U_FTE_TRANS )
574
+ MSG_ReadByte ();
575
+
576
+ if (morebits & U_FTE_COLOURMOD )
577
+ {
578
+ MSG_ReadByte (); // r
579
+ MSG_ReadByte (); // g
580
+ MSG_ReadByte (); // b
574
581
}
575
582
}
576
583
@@ -958,6 +965,13 @@ static void NetMsg_Parser_Parse_svc_spawnstatic(void)
958
965
}
959
966
}
960
967
968
+ static void NetMsg_Parser_Parse_svc_fte_spawnstatic2 (void )
969
+ {
970
+ unsigned int entnum , bits , morebits ;
971
+ NetMsg_Parser_ParseEntityNum (& entnum , & bits , & morebits );
972
+ NetMsg_Parser_ParseEntityDelta (bits , morebits );
973
+ }
974
+
961
975
static void NetMsg_Parser_Parse_svc_spawnbaseline (void )
962
976
{
963
977
int i ;
@@ -975,6 +989,13 @@ static void NetMsg_Parser_Parse_svc_spawnbaseline(void)
975
989
}
976
990
}
977
991
992
+ static void NetMsg_Parser_Parse_svc_fte_spawnbaseline2 (void )
993
+ {
994
+ unsigned int entnum , bits , morebits ;
995
+ NetMsg_Parser_ParseEntityNum (& entnum , & bits , & morebits );
996
+ NetMsg_Parser_ParseEntityDelta (bits , morebits );
997
+ }
998
+
978
999
static void NetMsg_Parser_Parse_svc_temp_entity (void )
979
1000
{
980
1001
int i ;
@@ -1270,10 +1291,10 @@ static void NetMsg_Parser_Parse_svc_chokecount(void)
1270
1291
MSG_ReadByte ();
1271
1292
}
1272
1293
1273
- static void NetMsg_Parser_Parse_svc_modellist (void )
1294
+ static void NetMsg_Parser_Parse_svc_modellist (qbool extended )
1274
1295
{
1275
1296
char * str ;
1276
- int model_count = MSG_ReadByte ();
1297
+ int model_count = extended ? MSG_ReadShort () : MSG_ReadByte ();
1277
1298
1278
1299
while (true)
1279
1300
{
@@ -1313,6 +1334,39 @@ static void NetMsg_Parser_Parse_svc_soundlist(mvd_info_t *mvd)
1313
1334
MSG_ReadByte (); // Ignore.
1314
1335
}
1315
1336
1337
+ static void NetMsg_Parser_ParsePacketEntities (mvd_info_t * mvd , qbool delta )
1338
+ {
1339
+ if (delta )
1340
+ {
1341
+ MSG_ReadByte ();
1342
+ if ((outgoing_sequence - incoming_sequence - 1 ) >= UPDATE_MASK )
1343
+ {
1344
+ return ;
1345
+ }
1346
+ }
1347
+
1348
+ while (true)
1349
+ {
1350
+ unsigned int entnum , bits , morebits ;
1351
+
1352
+ NetMsg_Parser_ParseEntityNum (& entnum , & bits , & morebits );
1353
+
1354
+ if (msg_badread )
1355
+ {
1356
+ // Something didn't parse right...
1357
+ Sys_PrintError ("NetMsg_Parser_ParsePacketEntities: msg_badread in packetentities.\n" );
1358
+ return ;
1359
+ }
1360
+
1361
+ if (!entnum )
1362
+ {
1363
+ break ;
1364
+ }
1365
+
1366
+ NetMsg_Parser_ParseEntityDelta (bits , morebits );
1367
+ }
1368
+ }
1369
+
1316
1370
static void NetMsg_Parser_Parse_svc_packetentities (mvd_info_t * mvd )
1317
1371
{
1318
1372
NetMsg_Parser_ParsePacketEntities (mvd , false);
@@ -1541,7 +1595,12 @@ qbool NetMsg_Parser_StartParse(mvd_info_t *mvd)
1541
1595
}
1542
1596
case svc_modellist :
1543
1597
{
1544
- NetMsg_Parser_Parse_svc_modellist ();
1598
+ NetMsg_Parser_Parse_svc_modellist (false);
1599
+ break ;
1600
+ }
1601
+ case svc_fte_modellistshort :
1602
+ {
1603
+ NetMsg_Parser_Parse_svc_modellist (true);
1545
1604
break ;
1546
1605
}
1547
1606
case svc_soundlist :
@@ -1559,6 +1618,11 @@ qbool NetMsg_Parser_StartParse(mvd_info_t *mvd)
1559
1618
NetMsg_Parser_Parse_svc_spawnbaseline ();
1560
1619
break ;
1561
1620
}
1621
+ case svc_fte_spawnbaseline2 :
1622
+ {
1623
+ NetMsg_Parser_Parse_svc_fte_spawnbaseline2 ();
1624
+ break ;
1625
+ }
1562
1626
case svc_updatefrags :
1563
1627
{
1564
1628
NetMsg_Parser_Parse_svc_updatefrags (mvd );
@@ -1674,6 +1738,11 @@ qbool NetMsg_Parser_StartParse(mvd_info_t *mvd)
1674
1738
NetMsg_Parser_Parse_svc_spawnstatic ();
1675
1739
break ;
1676
1740
}
1741
+ case svc_fte_spawnstatic2 :
1742
+ {
1743
+ NetMsg_Parser_Parse_svc_fte_spawnstatic2 ();
1744
+ break ;
1745
+ }
1677
1746
case svc_foundsecret :
1678
1747
{
1679
1748
NetMsg_Parser_Parse_svc_foundsecret ();
0 commit comments