BotAddCommand is thiscall on linux

This commit is contained in:
rtldg 2021-04-11 15:13:33 +00:00
parent 9e39c10e28
commit 3dc54c8974
2 changed files with 40 additions and 10 deletions

View File

@ -49,6 +49,12 @@
"linux" "19" "linux" "19"
"mac" "19" "mac" "19"
} }
"BotAddCommand_ThisCall"
{
"windows" "0"
"linux" "1"
"mac" "1"
}
} }
"Addresses" "Addresses"
@ -105,6 +111,12 @@
"linux" "9" "linux" "9"
"mac" "9" "mac" "9"
} }
"BotAddCommand_ThisCall"
{
"windows" "0"
"linux" "1"
"mac" "1"
}
} }
"Addresses" "Addresses"

View File

@ -176,6 +176,7 @@ Handle gH_BotAddCommand = INVALID_HANDLE;
DynamicDetour gH_MaintainBotQuota = null; DynamicDetour gH_MaintainBotQuota = null;
int gI_WEAPONTYPE_UNKNOWN = 123123123; int gI_WEAPONTYPE_UNKNOWN = 123123123;
int gI_LatestClient = -1; int gI_LatestClient = -1;
bool gB_BotAddCommand_ThisCall = false;
// how do i call this // how do i call this
bool gB_HideNameChange = false; bool gB_HideNameChange = false;
@ -410,13 +411,15 @@ void LoadDHooks()
SetFailState("Failed to load shavit gamedata"); SetFailState("Failed to load shavit gamedata");
} }
StartPrepSDKCall(SDKCall_Static); gB_BotAddCommand_ThisCall = view_as<bool>(gamedata.GetOffset("BotAddCommand_ThisCall"));
StartPrepSDKCall(gB_BotAddCommand_ThisCall ? SDKCall_Raw : SDKCall_Static);
if (gEV_Type == Engine_TF2) if (gEV_Type == Engine_TF2)
{ {
if (!PrepSDKCall_SetFromConf(gamedata, SDKConf_Signature, "NextBotCreatePlayerBot<CTFBot>")) if (!PrepSDKCall_SetFromConf(gamedata, SDKConf_Signature, "NextBotCreatePlayerBot<CTFBot>"))
{ {
SetFailState("Failed to get CCSBotManager::BotAddCommand"); SetFailState("Failed to get NextBotCreatePlayerBot<CTFBot>");
} }
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer); // const char *name PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer); // const char *name
@ -1506,14 +1509,29 @@ int InternalCreateReplayBot()
} }
else else
{ {
/*int ret =*/ SDKCall( if (gB_BotAddCommand_ThisCall)
gH_BotAddCommand, {
gCV_DefaultTeam.IntValue, // team /*int ret =*/ SDKCall(
false, // isFromConsole gH_BotAddCommand,
0, // profileName // unused 0x10000, // thisptr // unused
gI_WEAPONTYPE_UNKNOWN, // CSWeaponType // WEAPONTYPE_UNKNOWN gCV_DefaultTeam.IntValue, // team
0 // BotDifficultyType // unused false, // isFromConsole
); 0, // profileName // unused
gI_WEAPONTYPE_UNKNOWN, // CSWeaponType // WEAPONTYPE_UNKNOWN
0 // BotDifficultyType // unused
);
}
else
{
/*int ret =*/ SDKCall(
gH_BotAddCommand,
gCV_DefaultTeam.IntValue, // team
false, // isFromConsole
0, // profileName // unused
gI_WEAPONTYPE_UNKNOWN, // CSWeaponType // WEAPONTYPE_UNKNOWN
0 // BotDifficultyType // unused
);
}
//bool success = (0xFF & ret) != 0; //bool success = (0xFF & ret) != 0;
} }