CPointTeleport::Activate
0x007d9930 · 657 bytes · __thiscall
_ZN14CPointTeleport8ActivateEv
Decompiled
undefined (1 param)
/* CPointTeleport::Activate() */
void __thiscall CPointTeleport::Activate(CPointTeleport *this)
{
uint uVar1;
char cVar2;
char *pcVar3;
CBaseEntity *this_00;
CBaseEntity *this_01;
undefined4 uVar4;
undefined4 uVar5;
undefined4 uVar6;
undefined *puVar7;
undefined1 *puVar8;
if (((byte)this[0x14d] & 8) == 0) {
*(undefined4 *)(this + 0x440) = *(undefined4 *)(this + 0x2e0);
*(undefined4 *)(this + 0x444) = *(undefined4 *)(this + 0x2e4);
*(undefined4 *)(this + 0x448) = *(undefined4 *)(this + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
*(undefined4 *)(this + 0x440) = *(undefined4 *)(this + 0x2e0);
*(undefined4 *)(this + 0x444) = *(undefined4 *)(this + 0x2e4);
*(undefined4 *)(this + 0x448) = *(undefined4 *)(this + 0x2e8);
if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
}
*(undefined4 *)(this + 0x44c) = *(undefined4 *)(this + 0x37c);
*(undefined4 *)(this + 0x450) = *(undefined4 *)(this + 0x380);
*(undefined4 *)(this + 0x454) = *(undefined4 *)(this + 900);
if (((byte)this[0x148] & 1) != 0) {
pcVar3 = *(char **)(this + 0xf8);
if (pcVar3 == (char *)0x0) {
pcVar3 = "";
}
this_00 = (CBaseEntity *)
CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar3,(CBaseEntity *)0x0,
(CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
if (this_00 == (CBaseEntity *)0x0) {
puVar8 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0xf8) != (undefined1 *)0x0) {
puVar8 = *(undefined1 **)(this + 0xf8);
}
uVar4 = CBaseEntity::GetDebugName((CBaseEntity *)this);
Warning("ERROR: (%s) target \'%s\' not found. Deleting.\n",uVar4,puVar8);
UTIL_Remove((CBaseEntity *)this);
return;
}
cVar2 = EntityMayTeleport(this,this_00);
if (cVar2 == '\0') {
uVar1 = *(uint *)(this_00 + 0x188);
if (((uVar1 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) {
this_01 = (CBaseEntity *)0x0;
}
else {
this_01 = *(CBaseEntity **)(puVar7 + 4);
}
uVar4 = CBaseEntity::GetDebugName(this_01);
uVar5 = CBaseEntity::GetDebugName(this_00);
uVar6 = CBaseEntity::GetDebugName((CBaseEntity *)this);
Warning("ERROR: (%s) can\'t teleport object (%s) as it has a parent (%s)!\n",uVar6,uVar5,uVar4
);
CBaseEntity::Activate((CBaseEntity *)this);
return;
}
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
*(undefined4 *)(this + 0x440) = *(undefined4 *)(this_00 + 0x2e0);
*(undefined4 *)(this + 0x444) = *(undefined4 *)(this_00 + 0x2e4);
*(undefined4 *)(this + 0x448) = *(undefined4 *)(this_00 + 0x2e8);
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
*(undefined4 *)(this + 0x44c) = *(undefined4 *)(this_00 + 0x37c);
*(undefined4 *)(this + 0x450) = *(undefined4 *)(this_00 + 0x380);
*(undefined4 *)(this + 0x454) = *(undefined4 *)(this_00 + 900);
}
CBaseEntity::Activate((CBaseEntity *)this);
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.