diff --git a/src/server/gamerules.h b/src/server/gamerules.h index 7abdcb5..bd22b39 100644 --- a/src/server/gamerules.h +++ b/src/server/gamerules.h @@ -19,6 +19,7 @@ class SHMultiplayerRules:CGameRules { float m_flRestockTimer; + float m_flBreakRespawnTimer; /* client */ virtual void(base_player) PlayerSpawn; diff --git a/src/server/gamerules.qc b/src/server/gamerules.qc index 5a848dc..3861379 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -309,14 +309,30 @@ SHMultiplayerRules::ScientistKill(base_player pp, entity sci) void SHMultiplayerRules::FrameStart(void) { + entity e; + if (m_flRestockTimer < time) { m_flRestockTimer = time + 120.0f; - for ( entity e = world; ( e = find( e, ::classname, "player" ) ); ) { + for (e = world; (e = find(e, ::classname, "player"));) { player pl = (player)e; SHData_GetItems(pl); } } + + if (autocvar(sh_respbreak, 1)) + if (m_flBreakRespawnTimer < time) { + m_flBreakRespawnTimer = time + 120.0f; + + for (e = world; (e = find( e, ::classname, "func_breakable"));) { + func_breakable br = (func_breakable)e; + br.Respawn(); + } + for (e = world; (e = find( e, ::classname, "func_pushable"));) { + func_pushable pb = (func_pushable)e; + pb.Respawn(); + } + } } void