Init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
"Games"
|
||||
{
|
||||
"csgo"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"ValidateLineOfSight"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\xE4\xF8\x81\xEC\xF8\x00\x00\x00\x56\x8B\x75\x08"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x7C\x01\x00\x00\x8B\x5D\x0C\x8B\x75\x08"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
#pragma semicolon 1
|
||||
#pragma newdecls required
|
||||
|
||||
#include <sourcemod>
|
||||
#include <sdktools>
|
||||
#include <dhooks>
|
||||
|
||||
Handle g_hValidateLineOfSight = null;
|
||||
|
||||
public Plugin myinfo = {
|
||||
name = "[CS:GO] BumpWeapon Fix",
|
||||
author = "SHUFEN from POSSESSION.tokyo",
|
||||
description = "Ignore to validate line-of-sight when pick up weapons",
|
||||
version = "20190331",
|
||||
url = "https://possession.tokyo"
|
||||
};
|
||||
|
||||
public void OnPluginStart() {
|
||||
Handle hGameConf = LoadGameConfigFile("BumpWeaponFix.games");
|
||||
if (hGameConf == null) {
|
||||
SetFailState("Couldn't load BumpWeaponFix.games game config!");
|
||||
return;
|
||||
}
|
||||
|
||||
// ValidateLineOfSight
|
||||
g_hValidateLineOfSight = DHookCreateDetour(Address_Null, CallConv_THISCALL, ReturnType_Bool, ThisPointer_CBaseEntity);
|
||||
if (!g_hValidateLineOfSight) {
|
||||
delete hGameConf;
|
||||
SetFailState("Failed to setup detour for \"ValidateLineOfSight\"");
|
||||
}
|
||||
if (!DHookSetFromConf(g_hValidateLineOfSight, hGameConf, SDKConf_Signature, "ValidateLineOfSight")) {
|
||||
delete hGameConf;
|
||||
SetFailState("Failed to load \"ValidateLineOfSight\" signature from gamedata");
|
||||
}
|
||||
DHookAddParam(g_hValidateLineOfSight, HookParamType_Int);
|
||||
if (!DHookEnableDetour(g_hValidateLineOfSight, false, Detour_ValidateLineOfSight)) {
|
||||
delete hGameConf;
|
||||
SetFailState("Failed to detour \"ValidateLineOfSight\"");
|
||||
}
|
||||
|
||||
delete hGameConf;
|
||||
}
|
||||
|
||||
public MRESReturn Detour_ValidateLineOfSight(Address pThis, Handle hReturn, Handle hParams) {
|
||||
DHookSetReturn(hReturn, true);
|
||||
return MRES_ChangedOverride;
|
||||
}
|
||||
Reference in New Issue
Block a user