CBasePlayer::AdjustPlayerTimeBase
0x007bbad0 · 421 bytes · __thiscall
_ZN11CBasePlayer20AdjustPlayerTimeBaseEi
Decompiled
undefined (2 params)
/* CBasePlayer::AdjustPlayerTimeBase(int) */
void __thiscall CBasePlayer::AdjustPlayerTimeBase(CBasePlayer *this,int param_1)
{
ushort uVar1;
CBaseEdict *this_00;
undefined4 uVar2;
uint uVar3;
int iVar4;
int iVar5;
int iVar6;
int iVar7;
float fVar8;
if (param_1 < 0) {
return;
}
iVar6 = 0;
if (0 < *(int *)(sv_playerperfhistorycount._28_4_ + 0x30)) {
if (*(int *)(sv_playerperfhistorycount._28_4_ + 0x30) < (int)(uint)*(ushort *)(this + 0x22fa)) {
do {
uVar1 = *(ushort *)(this + 0x22f4);
CUtlLinkedList<CPlayerSimInfo,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CPlayerSimInfo,unsigned_short>,unsigned_short>>
::Unlink((CUtlLinkedList<CPlayerSimInfo,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CPlayerSimInfo,unsigned_short>,unsigned_short>>
*)(this + 0x22e8),uVar1);
*(undefined2 *)(*(int *)(this + 0x22e8) + (uint)uVar1 * 0x28 + 0x26) =
*(undefined2 *)(this + 0x22f8);
uVar2 = sv_playerperfhistorycount._28_4_;
*(ushort *)(this + 0x22f8) = uVar1;
} while (*(int *)(uVar2 + 0x30) < (int)(uint)*(ushort *)(this + 0x22fa));
}
uVar3 = CUtlLinkedList<CPlayerSimInfo,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CPlayerSimInfo,unsigned_short>,unsigned_short>>
::InsertBefore((CUtlLinkedList<CPlayerSimInfo,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CPlayerSimInfo,unsigned_short>,unsigned_short>>
*)(this + 0x22e8),0xffff);
iVar6 = *(int *)(this + 0x22e8) + (uVar3 & 0xffff) * 0x28;
}
if (*(int *)(gpGlobals + 0x14) == 1) {
iVar7 = (*(int *)(gpGlobals + 0x18) - param_1) + *(int *)(gpGlobals + 0x24);
if (iVar7 == *(int *)(this + 0x2054)) goto LAB_007bbc22;
if (this[0x6c] != (CBasePlayer)0x0) goto LAB_007bbc77;
LAB_007bbc01:
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
fVar8 = *(float *)(sv_clockcorrection_msecs._28_4_ + 0x2c) * 0.001;
if (fVar8 <= 0.0) {
fVar8 = 0.0;
}
if (1.0 <= fVar8) {
fVar8 = 1.0;
}
iVar5 = (int)(fVar8 / *(float *)(gpGlobals + 0x1c) + 0.5);
iVar7 = *(int *)(gpGlobals + 0x18) + iVar5;
iVar4 = *(int *)(this + 0x2054);
if ((param_1 + iVar4 <= iVar7 + iVar5) && (*(int *)(gpGlobals + 0x18) <= param_1 + iVar4))
goto LAB_007bbc22;
iVar7 = (iVar7 - param_1) + *(int *)(gpGlobals + 0x24);
if (iVar6 != 0) {
*(int *)(iVar6 + 8) = iVar5;
iVar4 = *(int *)(this + 0x2054);
}
if (iVar7 == iVar4) goto LAB_007bbc22;
if (this[0x6c] == (CBasePlayer)0x0) goto LAB_007bbc01;
LAB_007bbc77:
this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x2054) = iVar7;
LAB_007bbc22:
if (iVar6 != 0) {
*(float *)(iVar6 + 0xc) =
(float)(param_1 + *(int *)(this + 0x2054) + *(int *)(gpGlobals + 0x24)) *
*(float *)(gpGlobals + 0x1c);
}
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.