Skip to content

Commit

Permalink
revert to tf_bot_add instead of NextBot.. gamedata & fix maintainbotq…
Browse files Browse the repository at this point in the history
…uota sig
  • Loading branch information
rtldg committed Apr 23, 2024
1 parent 9876d4c commit 5814a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 38 deletions.
8 changes: 1 addition & 7 deletions addons/sourcemod/gamedata/shavit.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,9 @@
// search string: "match"
"BotManager::MaintainBotQuota"
{
"windows" "\x55\x8B\xEC\x81\xEC\x14\x01\x00\x00\xA1"
"windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x81\xEC\x10\x01\x00\x00\x83\xB8\x2A\x2A\x2A\x2A\x00"
"linux" "@_ZN13CTFBotManager16MaintainBotQuotaEv"
}
// search string: "CreatePlayerBot: Unable to create bot"
"NextBotCreatePlayerBot<CTFBot>"
{
"windows" "\x55\x8B\xEC\x56\x57\x68\x2A\x2A\x2A\x2A\xE8"
"linux" "@_Z22NextBotCreatePlayerBotI6CTFBotEPT_PKcb"
}
// search string: "remove 0x%p: %s-%s" to find PhysicsRemoveToucher.
// Find PhysicsCheckForEntityUntouch by checking the functions that call PhysicsRemoveToucher.
"PhysicsCheckForEntityUntouch"
Expand Down
34 changes: 3 additions & 31 deletions addons/sourcemod/scripting/shavit-replay-playback.sp
Original file line number Diff line number Diff line change
Expand Up @@ -526,25 +526,7 @@ void LoadDHooks()

gB_Linux = (gamedata.GetOffset("OS") == 2);

if (gEV_Type == Engine_TF2)
{
StartPrepSDKCall(SDKCall_Static);

if (!PrepSDKCall_SetFromConf(gamedata, SDKConf_Signature, "NextBotCreatePlayerBot<CTFBot>"))
{
SetFailState("Failed to get NextBotCreatePlayerBot<CTFBot>");
}

PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer); // const char *name
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain); // bool bReportFakeClient
PrepSDKCall_SetReturnInfo(SDKType_CBasePlayer, SDKPass_Pointer); // CTFBot*

if (!(gH_BotAddCommand = EndPrepSDKCall()))
{
SetFailState("Unable to prepare SDKCall for NextBotCreatePlayerBot<CTFBot>");
}
}
else
if (gEV_Type != Engine_TF2)
{
StartPrepSDKCall(gB_Linux ? SDKCall_Raw : SDKCall_Static);

Expand Down Expand Up @@ -1790,18 +1772,8 @@ int InternalCreateReplayBot()

if (gEV_Type == Engine_TF2)
{
int bot = SDKCall(
gH_BotAddCommand,
"replaybot", // name
true // bReportFakeClient
);

if (IsValidClient(bot))
{
TF2_ChangeClientTeam(bot, TFTeam_Red);
TF2_SetPlayerClass(bot, TFClass_Sniper);
SetFakeClientConVar(bot, "name", "replaybot");
}
char output[12];
ServerCommandEx(output, sizeof(output), "tf_bot_add red sniper noquota replaybot");
}
else
{
Expand Down

0 comments on commit 5814a7c

Please sign in to comment.