CTerrorPlayer::SetCharacter
0x0099a5b0 · 441 bytes · __thiscall
_ZN13CTerrorPlayer12SetCharacterE21SurvivorCharacterType
Decompiled
undefined (2 params)
/* CTerrorPlayer::SetCharacter(SurvivorCharacterType) */
void __thiscall CTerrorPlayer::SetCharacter(CTerrorPlayer *this,int param_2)
{
CBaseEdict *pCVar1;
code *UNRECOVERED_JUMPTABLE;
code *pcVar2;
char cVar3;
int iVar4;
int *piVar5;
undefined4 *puVar6;
puVar6 = (undefined4 *)&stack0xffffffc4;
iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
cVar3 = IsASurvivorTeam(iVar4);
if (cVar3 == '\0') {
if (*(int *)(this + 0x2ba0) != 8) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2ba0) = 8;
piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
puVar6 = (undefined4 *)&stack0xffffffc4;
goto joined_r0x0099a714;
}
}
else {
iVar4 = *(int *)(this + 0x2ba0);
if (iVar4 != 8) {
(**(code **)(*(int *)this + 0x534))();
iVar4 = *(int *)(this + 0x2ba0);
}
if (iVar4 != param_2) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x2ba0) = param_2;
}
(**(code **)(*(int *)this + 0x20))();
SurvivorCharacterName();
(**(code **)(*(int *)this + 0xb8))();
UTIL_LogPrintf("(SKIN) SetCharacter: Survivor %s chose character %s(%d) from model %s\n");
cVar3 = (**(code **)(*(int *)this + 0x5a8))();
puVar6 = (undefined4 *)&stack0xffffffc0;
if (cVar3 != '\0') {
UNRECOVERED_JUMPTABLE = *(code **)(*engine + 0x15c);
SurvivorCharacterDisplayName();
(*UNRECOVERED_JUMPTABLE)();
puVar6 = (undefined4 *)&stack0xffffffc0;
}
}
*puVar6 = this;
puVar6[-1] = 0x99a697;
piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)*puVar6);
joined_r0x0099a714:
if (piVar5 != (int *)0x0) {
iVar4 = *piVar5;
*puVar6 = piVar5;
UNRECOVERED_JUMPTABLE = *(code **)(iVar4 + 0x3fc);
puVar6[-1] = 0x99a6a8;
(*UNRECOVERED_JUMPTABLE)();
iVar4 = *piVar5;
UNRECOVERED_JUMPTABLE = *(code **)(iVar4 + 0x70);
*puVar6 = piVar5;
puVar6[1] = 0;
pcVar2 = *(code **)(iVar4 + 0x504);
puVar6[-1] = 0x99a6be;
(*pcVar2)();
/* WARNING: Could not recover jumptable at 0x0099a6cd. Too many branches */
/* WARNING: Treating indirect jump as call */
(*UNRECOVERED_JUMPTABLE)();
return;
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.