Last active
July 1, 2019 04:39
-
-
Save nosoop/08774339937179d0022a541b05b51c8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Games" | |
{ | |
"tf" | |
{ | |
"Addresses" | |
{ | |
"CTraceFilterObject::ShouldHitEntity()::TFBotCollideWithBuildings" | |
{ | |
"signature" "CTraceFilterObject::ShouldHitEntity()" | |
"linux" | |
{ | |
"offset" "422" // 0x1A6 | |
} | |
} | |
} | |
"Signatures" | |
{ | |
"CTraceFilterObject::ShouldHitEntity()" | |
{ | |
"library" "server" | |
"linux" "@_ZN18CTraceFilterObject15ShouldHitEntityEP13IHandleEntityi" | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Patches collisions so TFBots can't hide inside their buildings. | |
* Thanks @Deathreus for the disassembly snooping. | |
*/ | |
#pragma semicolon 1 | |
#include <sourcemod> | |
#pragma newdecls required | |
public void OnPluginStart() { | |
Handle hGameConf = LoadGameConfigFile("tf2.engineer_bot_collide_sentry"); | |
if (!hGameConf) { | |
SetFailState("Failed to load gamedata (tf2.engineer_bot_collide_sentry)."); | |
} | |
Address patch = GameConfGetAddress(hGameConf, "CTraceFilterObject::ShouldHitEntity()::TFBotCollideWithBuildings"); | |
// yolo patch the jump that checks CBasePlayer::IsBotOfType() and performs additional checks | |
StoreToAddress(patch, 0x70, NumberType_Int8); | |
delete hGameConf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implementation of the patch using my new Source Scramble extension and manager plugin to do most of the heavy lifting: