HLMultiplayerRules: add PlayerRequestSpawn method override

This commit is contained in:
Marco Cawthorne 2023-01-11 18:04:17 -08:00
parent 70167ed233
commit bef240a1de
Signed by: eukara
GPG key ID: CE2032F0A2882A22
2 changed files with 21 additions and 8 deletions

View file

@ -16,16 +16,17 @@
class HLGameRules:CGameRules class HLGameRules:CGameRules
{ {
virtual void(NSClientPlayer) PlayerConnect; virtual void PlayerConnect(NSClientPlayer);
virtual void(NSClientPlayer) PlayerDisconnect; virtual void PlayerDisconnect(NSClientPlayer);
virtual void(NSClientPlayer) PlayerKill; virtual void PlayerKill(NSClientPlayer);
virtual void(NSClientPlayer) PlayerPostFrame; virtual void PlayerPostFrame(NSClientPlayer);
virtual void(NSClientPlayer) LevelDecodeParms; virtual void LevelDecodeParms(NSClientPlayer);
virtual void(NSClientPlayer) LevelChangeParms; virtual void LevelChangeParms(NSClientPlayer);
virtual void(void) LevelNewParms; virtual void LevelNewParms(void);
virtual bool IsMultiplayer(void);
virtual bool(void) IsMultiplayer;
virtual bool ImpulseCommand(NSClient, float); virtual bool ImpulseCommand(NSClient, float);
}; };
@ -57,4 +58,5 @@ class HLMultiplayerRules:HLGameRules
virtual bool(void) IsMultiplayer; virtual bool(void) IsMultiplayer;
virtual bool(void) IsTeamplay; virtual bool(void) IsTeamplay;
virtual void(void) InitPostEnts; virtual void(void) InitPostEnts;
virtual bool PlayerRequestRespawn(NSClientPlayer);
}; };

View file

@ -23,6 +23,17 @@ HLMultiplayerRules::IsMultiplayer(void)
return true; return true;
} }
bool
HLMultiplayerRules::PlayerRequestRespawn(NSClientPlayer bp)
{
if (bp.TimeSinceDeath() > 0.5f) {
bp.ScheduleThink(PutClientInServer, 0.0f);
return true;
}
return false;
}
bool bool
HLMultiplayerRules::IsTeamplay(void) HLMultiplayerRules::IsTeamplay(void)
{ {