mirror of
https://github.com/GAMMACASE/NoclipSpeed.git
synced 2025-12-07 10:28:37 +00:00
CSS compatibility
This commit is contained in:
parent
995fcbd231
commit
174718d8ee
@ -1,9 +1,6 @@
|
|||||||
# NoclipSpeed
|
# NoclipSpeed
|
||||||
SourceMod plugin that allows players to change noclip speed.
|
SourceMod plugin that allows players to change noclip speed.
|
||||||
|
|
||||||
## Note
|
|
||||||
Only CSGO is currently supported.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
* [Dhooks with detour support](https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589);
|
* [Dhooks with detour support](https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589);
|
||||||
* SourceMod 1.10 or higher.
|
* SourceMod 1.10 or higher.
|
||||||
|
|||||||
@ -22,6 +22,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"Offsets"
|
||||||
|
{
|
||||||
|
"OSType"
|
||||||
|
{
|
||||||
|
"windows" "1"
|
||||||
|
"linux" "2"
|
||||||
|
}
|
||||||
|
|
||||||
|
"m_angRotation"
|
||||||
|
{
|
||||||
|
"class" "CBaseEntity"
|
||||||
|
"prop" "m_angRotation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"cstrike"
|
||||||
|
{
|
||||||
|
"Keys"
|
||||||
|
{
|
||||||
|
//CGameMovement
|
||||||
|
"CGameMovement::player" "4"
|
||||||
|
|
||||||
|
//CBaseEntity
|
||||||
|
//Offset is relative to m_angRotation netprop
|
||||||
|
"CBaseEntity::m_RefEHandle" "12"
|
||||||
|
}
|
||||||
|
|
||||||
|
"Signatures"
|
||||||
|
{
|
||||||
|
"CGameMovement::FullNoClipMove"
|
||||||
|
{
|
||||||
|
"library" "server"
|
||||||
|
"windows" "\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\x83\xEC\x6C\xA1\x2A\x2A\x2A\x2A"
|
||||||
|
"linux" "@_ZN13CGameMovement14FullNoClipMoveEff"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"Offsets"
|
"Offsets"
|
||||||
{
|
{
|
||||||
"OSType"
|
"OSType"
|
||||||
|
|||||||
@ -20,13 +20,13 @@ public Plugin myinfo =
|
|||||||
#define MAX_EDICT_BITS 11
|
#define MAX_EDICT_BITS 11
|
||||||
#define MAX_EDICTS (1 << MAX_EDICT_BITS)
|
#define MAX_EDICTS (1 << MAX_EDICT_BITS)
|
||||||
|
|
||||||
#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 2)
|
#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 1)
|
||||||
#define NUM_ENT_ENTRIES (1 << NUM_ENT_ENTRY_BITS)
|
#define NUM_ENT_ENTRIES (1 << NUM_ENT_ENTRY_BITS)
|
||||||
#define INVALID_EHANDLE_INDEX 0xFFFFFFFF
|
#define INVALID_EHANDLE_INDEX 0xFFFFFFFF
|
||||||
|
|
||||||
#define NUM_SERIAL_NUM_BITS 16 // (32 - NUM_ENT_ENTRY_BITS)
|
#define NUM_SERIAL_NUM_BITS 16 // (32 - NUM_ENT_ENTRY_BITS)
|
||||||
#define NUM_SERIAL_NUM_SHIFT_BITS (32 - NUM_SERIAL_NUM_BITS)
|
#define NUM_SERIAL_NUM_SHIFT_BITS (32 - NUM_SERIAL_NUM_BITS)
|
||||||
#define ENT_ENTRY_MASK (( 1 << NUM_SERIAL_NUM_BITS) - 1)
|
#define ENT_ENTRY_MASK (NUM_ENT_ENTRIES - 1)
|
||||||
|
|
||||||
enum OSType
|
enum OSType
|
||||||
{
|
{
|
||||||
@ -48,8 +48,12 @@ ConVar sv_maxspeed;
|
|||||||
ConVar sv_friction;
|
ConVar sv_friction;
|
||||||
ConVar sv_noclipspeed;
|
ConVar sv_noclipspeed;
|
||||||
|
|
||||||
|
EngineVersion gEV_Type;
|
||||||
|
|
||||||
public void OnPluginStart()
|
public void OnPluginStart()
|
||||||
{
|
{
|
||||||
|
gEV_Type = GetEngineVersion();
|
||||||
|
|
||||||
RegConsoleCmd("sm_ns", SM_NoclipSpeed, "Sets noclip speed.");
|
RegConsoleCmd("sm_ns", SM_NoclipSpeed, "Sets noclip speed.");
|
||||||
RegConsoleCmd("sm_noclipspeed", SM_NoclipSpeed, "Sets noclip speed.");
|
RegConsoleCmd("sm_noclipspeed", SM_NoclipSpeed, "Sets noclip speed.");
|
||||||
|
|
||||||
@ -101,8 +105,16 @@ void SetupDhooks(GameData gd)
|
|||||||
ASSERT_MSG(DHookSetFromConf(dhook, gd, SDKConf_Signature, "CGameMovement::FullNoClipMove"), "Failed to find \"CGameMovement::FullNoClipMove\" signature.");
|
ASSERT_MSG(DHookSetFromConf(dhook, gd, SDKConf_Signature, "CGameMovement::FullNoClipMove"), "Failed to find \"CGameMovement::FullNoClipMove\" signature.");
|
||||||
|
|
||||||
DHookAddParam(dhook, HookParamType_Int, .custom_register = DHookRegister_ECX);
|
DHookAddParam(dhook, HookParamType_Int, .custom_register = DHookRegister_ECX);
|
||||||
DHookAddParam(dhook, HookParamType_Float, .custom_register = DHookRegister_XMM1);
|
if(gEV_Type == Engine_CSGO)
|
||||||
DHookAddParam(dhook, HookParamType_Float, .custom_register = DHookRegister_XMM2);
|
{
|
||||||
|
DHookAddParam(dhook, HookParamType_Float, .custom_register = DHookRegister_XMM1);
|
||||||
|
DHookAddParam(dhook, HookParamType_Float, .custom_register = DHookRegister_XMM2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DHookAddParam(dhook, HookParamType_Float);
|
||||||
|
DHookAddParam(dhook, HookParamType_Float);
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT_MSG(DHookEnableDetour(dhook, false, FullNoClipMove_Dhook), "Failed to enable \"CGameMovement::FullNoClipMove\" detour.");
|
ASSERT_MSG(DHookEnableDetour(dhook, false, FullNoClipMove_Dhook), "Failed to enable \"CGameMovement::FullNoClipMove\" detour.");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user