diff --git a/Couch/gamedata/Couch.txt b/Couch/gamedata/Couch.txt index 45f8821..e292e1d 100644 --- a/Couch/gamedata/Couch.txt +++ b/Couch/gamedata/Couch.txt @@ -8,6 +8,7 @@ "ForceVPhysicsCollide" { "linux" "160" + "linux64" "160" "windows" "159" } @@ -15,6 +16,7 @@ "PlayerUse" { "linux" "414" + "linux64" "414" "windows" "413" } } @@ -28,6 +30,7 @@ { "library" "server" "linux" "@_ZN15CCollisionEvent13ShouldCollideEP14IPhysicsObjectS1_PvS2_" + "linux64" "@_ZN15CCollisionEvent13ShouldCollideEP14IPhysicsObjectS1_PvS2_" } // CBaseEntity::CollisionRulesChanged(). Makes vphysics re-ask ShouldCollide for cached pairs. @@ -35,6 +38,7 @@ { "library" "server" "linux" "@_ZN11CBaseEntity21CollisionRulesChangedEv" + "linux64" "@_ZN11CBaseEntity21CollisionRulesChangedEv" } } } diff --git a/Couch/scripting/Couch.sp b/Couch/scripting/Couch.sp index ce322d9..2c5bd36 100644 --- a/Couch/scripting/Couch.sp +++ b/Couch/scripting/Couch.sp @@ -1182,8 +1182,8 @@ void LoadGameData() } else { - DHookAddParam(g_hShouldCollideDetour, HookParamType_Int); // IPhysicsObject *pObj0 - DHookAddParam(g_hShouldCollideDetour, HookParamType_Int); // IPhysicsObject *pObj1 + DHookAddParam(g_hShouldCollideDetour, HookParamType_ObjectPtr); // IPhysicsObject *pObj0 (pointer-sized: 4 bytes x86, 8 bytes x64) + DHookAddParam(g_hShouldCollideDetour, HookParamType_ObjectPtr); // IPhysicsObject *pObj1 DHookAddParam(g_hShouldCollideDetour, HookParamType_CBaseEntity); // void *pGameData0: entity behind pObj0 DHookAddParam(g_hShouldCollideDetour, HookParamType_CBaseEntity); // void *pGameData1: entity behind pObj1 } diff --git a/Extend/gamedata/Extend.games.txt b/Extend/gamedata/Extend.games.txt index 3c6177e..0e46d86 100644 --- a/Extend/gamedata/Extend.games.txt +++ b/Extend/gamedata/Extend.games.txt @@ -10,6 +10,10 @@ { "signature" "g_fGameOver" } + "linux64" + { + "signature" "g_fGameOver" + } } } @@ -19,6 +23,7 @@ { "library" "server" "linux" "@g_fGameOver" + "linux64" "@g_fGameOver" } } } diff --git a/Extend/scripting/Extend.sp b/Extend/scripting/Extend.sp index 6ea08cf..6044439 100644 --- a/Extend/scripting/Extend.sp +++ b/Extend/scripting/Extend.sp @@ -3,43 +3,70 @@ #include #include +#include + +#undef REQUIRE_PLUGIN +#tryinclude +#define REQUIRE_PLUGIN #define VOTE_NO "###no###" #define VOTE_YES "###yes###" +#define PLUGIN_TAG "{green}[Extend]" -ConVar g_cvarExtendVoteTime = null; -ConVar g_cvarExtendVotePercent = null; -ConVar g_cvarMpMaxRounds = null; -ConVar g_cvarMpFragLimit = null; -ConVar g_cvarMpWinLimit = null; -ConVar g_cvarMpTimeLimit = null; +// Largest mp_timelimit we allow; floats are exact up to 2^24 and the engine also converts it to int +#define MAX_TIMELIMIT_MINUTES 16777216.0 -bool g_bGameOver = false; +int g_iNumAttempts = 0; +int g_iExtendCount = 0; +int g_iExtendTime = 0; +float g_fVoteRequired = 0.0; + +ConVar g_cvarExtendVoteTime; +ConVar g_cvarExtendVoteMaxDuration; +ConVar g_cvarExtendVotePercent; +ConVar g_cvarExtendVotePercentIncrement; +ConVar g_cvarExtendVotePercentMax; +ConVar g_cvarExtendVoteMaxFailedAttempt; +ConVar g_cvarExtendVote; +ConVar g_cvarMpMaxRounds; +ConVar g_cvarMpFragLimit; +ConVar g_cvarMpWinLimit; +ConVar g_cvarMpTimeLimit; +ConVar g_cvarRequireAllExtends; + +bool g_bCanCancelGameOver = false; Address g_pGameOver; public Plugin myinfo = { - name = "Map extend tools", - author = "Obus + BotoX", - description = "Adds map extension commands.", - version = "1.0", - url = "" + name = "Map Extend Tools", + author = "Obus, BotoX, .Rushaway, koen", + description = "Adds map extension commands.", + version = "1.4.5", + url = "" }; public void OnPluginStart() { LoadTranslations("common.phrases"); LoadTranslations("basevotes.phrases"); + LoadTranslations("extend.phrases"); g_cvarMpMaxRounds = FindConVar("mp_maxrounds"); g_cvarMpFragLimit = FindConVar("mp_fraglimit"); g_cvarMpWinLimit = FindConVar("mp_winlimit"); g_cvarMpTimeLimit = FindConVar("mp_timelimit"); + g_cvarExtendVote = CreateConVar("sm_extendvote_enabled", "1", "Enable Extend Vote? [1 = Enable | 0 = Disable]", FCVAR_NONE, true, 0.0, true, 1.0); g_cvarExtendVoteTime = CreateConVar("sm_extendvote_time", "15", "Time that will be added to mp_timelimit shall the extend vote succeed", FCVAR_NONE, true, 1.0); + g_cvarExtendVoteMaxDuration = CreateConVar("sm_extendvote_max_duration", "30", "Maximum minutes an admin can request with \"sm_extend