@@ -43,17 +43,17 @@ vec3_t VEC_HULL2_MAX =
43
43
int modelindex_eyes , modelindex_player , vwep_index ;
44
44
45
45
qbool can_prewar (qbool fire );
46
- void IdlebotCheck (void );
47
- void CheckAll (void );
48
- void PlayerStats (void );
49
- void ExitCaptain (void );
50
- void CheckFinishCaptain (void );
51
- void MakeMOTD (void );
52
- void ImpulseCommands (void );
53
- void StartDie (void );
54
- void ZeroFpsStats (void );
55
- void item_megahealth_rot (void );
56
-
46
+ void IdlebotCheck ();
47
+ void CheckAll ();
48
+ void PlayerStats ();
49
+ void ExitCaptain ();
50
+ void CheckFinishCaptain ();
51
+ void MakeMOTD ();
52
+ void ImpulseCommands ();
53
+ void StartDie ();
54
+ void ZeroFpsStats ();
55
+ void item_megahealth_rot ();
56
+ void SendSpecInfo ( gedict_t * spec , gedict_t * target_client );
57
57
void del_from_specs_favourites (gedict_t * rm );
58
58
void item_megahealth_rot (void );
59
59
@@ -1714,6 +1714,8 @@ void ClientConnect(void)
1714
1714
}
1715
1715
}
1716
1716
1717
+ SendSpecInfo (NULL , self ); // get all spectator info
1718
+
1717
1719
MakeMOTD ();
1718
1720
1719
1721
#ifdef BOT_SUPPORT
@@ -4454,35 +4456,46 @@ void CheckTeamStatus(void)
4454
4456
}
4455
4457
}
4456
4458
4457
- void SendSpecInfo (void )
4459
+ void SendSpecInfo (gedict_t * spec , gedict_t * target_client )
4458
4460
{
4459
4461
gedict_t * t , * p ;
4460
4462
int cl , tr ;
4461
4463
4462
- static double lastupdate = 0 ;
4463
-
4464
- if (g_globalvars .time - lastupdate < 2 )
4464
+ if (spec ) // if spec has a value, we only want to send that spec's info
4465
4465
{
4466
- return ;
4467
- }
4468
-
4469
- lastupdate = g_globalvars .time ;
4470
-
4471
- for (t = world ; (t = find_spc (t ));)
4472
- {
4473
- cl = NUM_FOR_EDICT (t ) - 1 ;
4474
- tr = NUM_FOR_EDICT (PROG_TO_EDICT (t -> s .v .goalentity )) - 1 ; // num for player spec is tracking
4466
+ cl = NUM_FOR_EDICT (spec ) - 1 ;
4467
+ tr = NUM_FOR_EDICT (PROG_TO_EDICT (spec -> s .v .goalentity )) - 1 ; // num for player spec is tracking
4475
4468
4476
4469
for (p = world ; (p = find_client (p ));)
4477
4470
{
4478
- if (p == t )
4479
- {
4471
+ if (p == spec )
4480
4472
continue ; // ignore self
4481
- }
4482
4473
4483
4474
stuffcmd_flags (p , STUFFCMD_IGNOREINDEMO , "//spi %d %d\n" , cl , tr );
4484
4475
}
4485
4476
}
4477
+ else {
4478
+ for (t = world ; (t = find_spc (t ));)
4479
+ {
4480
+ cl = NUM_FOR_EDICT (t ) - 1 ;
4481
+ tr = NUM_FOR_EDICT (PROG_TO_EDICT (t -> s .v .goalentity )) - 1 ; // num for player spec is tracking
4482
+
4483
+ if (target_client && target_client != t )
4484
+ {
4485
+ stuffcmd_flags (target_client , STUFFCMD_IGNOREINDEMO , "//spi %d %d\n" , cl , tr );
4486
+ }
4487
+ else // if no target client is specified, send to everyone
4488
+ {
4489
+ for (p = world ; (p = find_client (p ));)
4490
+ {
4491
+ if (p == t )
4492
+ continue ; // ignore self
4493
+
4494
+ stuffcmd_flags (p , STUFFCMD_IGNOREINDEMO , "//spi %d %d\n" , cl , tr );
4495
+ }
4496
+ }
4497
+ }
4498
+ }
4486
4499
}
4487
4500
4488
4501
void TookWeaponHandler (gedict_t * p , int new_wp , qbool from_backpack )
0 commit comments