From 7e410fd5d881a17286ea61d799f6f29a38eb834f Mon Sep 17 00:00:00 2001 From: Boondorl Date: Wed, 12 Mar 2025 08:15:19 -0400 Subject: [PATCH] Added cvar for cool downs on repeatable actions when playing online Currently only applies to doors. --- src/d_net.cpp | 1 + src/playsim/mapthinkers/a_doors.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/d_net.cpp b/src/d_net.cpp index 26502d9a99..2195d6d1c0 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -150,6 +150,7 @@ CVAR(Bool, vid_lowerinbackground, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(Bool, net_ticbalance, false, CVAR_SERVERINFO | CVAR_NOSAVE) // Currently deprecated, but may be brought back later. CVAR(Bool, net_extratic, false, CVAR_SERVERINFO | CVAR_NOSAVE) CVAR(Bool, net_disablepause, false, CVAR_SERVERINFO | CVAR_NOSAVE) +CVAR(Bool, net_repeatableactioncooldown, true, CVAR_SERVERINFO | CVAR_NOSAVE) CVAR(Bool, cl_noboldchat, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, cl_nochatsound, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) diff --git a/src/playsim/mapthinkers/a_doors.cpp b/src/playsim/mapthinkers/a_doors.cpp index e32068565d..c13c73aa99 100644 --- a/src/playsim/mapthinkers/a_doors.cpp +++ b/src/playsim/mapthinkers/a_doors.cpp @@ -42,6 +42,8 @@ #include "texturemanager.h" #include "vm.h" +EXTERN_CVAR(Bool, net_repeatableactioncooldown) + //============================================================================ // // VERTICAL DOORS @@ -486,6 +488,10 @@ bool FLevelLocals::EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing, return false; // JDC: bad guys never close doors //Added by MC: Neither do bots. + // Don't let users spam open/close doors when playing online. + if (net_repeatableactioncooldown && NetworkClients.Size() > 1) + return false; + door->m_Direction = -1; // start going down immediately // Start the door close sequence.