Gamerules: Call SHData_GetItems() every 2 minutes.

This commit is contained in:
Marco Cawthorne 2021-08-13 21:33:16 +02:00
parent ba28697b9e
commit d49c91200c
2 changed files with 25 additions and 1 deletions

View file

@ -18,6 +18,8 @@
class SHMultiplayerRules:CGameRules class SHMultiplayerRules:CGameRules
{ {
float m_flRestockTimer;
/* client */ /* client */
virtual void(base_player) PlayerSpawn; virtual void(base_player) PlayerSpawn;
virtual void(base_player) PlayerConnect; virtual void(base_player) PlayerConnect;
@ -30,4 +32,7 @@ class SHMultiplayerRules:CGameRules
virtual void(base_player) LevelDecodeParms; virtual void(base_player) LevelDecodeParms;
virtual void(base_player) LevelChangeParms; virtual void(base_player) LevelChangeParms;
virtual void(void) LevelNewParms; virtual void(void) LevelNewParms;
virtual void(void) FrameStart;
void(void) SHMultiplayerRules;
}; };

View file

@ -305,3 +305,22 @@ SHMultiplayerRules::ScientistKill(base_player pp, entity sci)
/* timer gets touched every time */ /* timer gets touched every time */
pl.sh_insanetime = time + 2.0f; pl.sh_insanetime = time + 2.0f;
} }
void
SHMultiplayerRules::FrameStart(void)
{
if (m_flRestockTimer < time) {
m_flRestockTimer = time + 120.0f;
for ( entity e = world; ( e = find( e, ::classname, "player" ) ); ) {
player pl = (player)e;
SHData_GetItems(pl);
}
}
}
void
SHMultiplayerRules::SHMultiplayerRules(void)
{
CGameRules::CGameRules();
}