CBaseEntity::Teleport
0x006152d0 · 1171 bytes · __thiscall
_ZN11CBaseEntity8TeleportEPK6VectorPK6QAngleS2_
Decompiled
undefined (4 params)
/* CBaseEntity::Teleport(Vector const*, QAngle const*, Vector const*) */
void __thiscall
CBaseEntity::Teleport(CBaseEntity *this,Vector *param_1,QAngle *param_2,Vector *param_3)
{
CCollisionProperty *this_00;
CBaseEntity *pCVar1;
undefined4 uVar2;
undefined4 uVar3;
undefined4 uVar4;
undefined4 uVar5;
undefined4 uVar6;
code *pcVar7;
CBaseEntity *this_01;
float fVar8;
float fVar9;
char cVar10;
int iVar11;
undefined4 *puVar12;
int iVar13;
void *pvVar14;
int *piVar15;
int iVar16;
CBaseEntity *local_8c;
undefined1 local_81;
int local_60;
CBaseEntity **local_50;
int local_4c [5];
CBaseEntity *local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined1 local_20;
if (0 < DAT_00fc0d14) {
if (this == (CBaseEntity *)*g_TeleportStack) {
return;
}
iVar11 = 0;
do {
iVar11 = iVar11 + 1;
if (iVar11 == DAT_00fc0d14) goto LAB_00615310;
} while (this != (CBaseEntity *)g_TeleportStack[iVar11]);
if (-1 < iVar11) {
return;
}
}
LAB_00615310:
local_38 = this;
iVar11 = CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::InsertBefore
((CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>> *)&g_TeleportStack,
DAT_00fc0d14,&local_38);
local_4c[0] = 0;
local_4c[1] = 0;
local_4c[2] = 0;
local_4c[3] = 0;
local_4c[4] = 0;
/* try { // try from 00615358 to 00615786 has its CatchHandler @ 0061578c */
BuildTeleportList_r(this,(CUtlVector *)local_4c);
if (0 < local_4c[3]) {
local_60 = 0;
do {
puVar12 = (undefined4 *)(local_60 * 0x1c + local_4c[0]);
this_01 = (CBaseEntity *)*puVar12;
pCVar1 = (CBaseEntity *)puVar12[1];
uVar2 = puVar12[2];
uVar3 = puVar12[3];
uVar4 = puVar12[4];
uVar5 = puVar12[5];
uVar6 = puVar12[6];
this_00 = (CCollisionProperty *)(this_01 + 0x194);
iVar13 = (**(code **)(*(int *)(this_01 + 0x194) + 0x30))(this_00);
CCollisionProperty::SetSolidFlags(this_00,(uint)(*(ushort *)(this_01 + 0x1b4) | 4));
if (this == this_01) {
if (param_2 != (QAngle *)0x0) {
SetLocalAngles(this,param_2);
cVar10 = (**(code **)(*(int *)this + 0x16c))(this);
if (cVar10 != '\0') {
CBasePlayer::SnapEyeAngles((CBasePlayer *)this,param_2);
}
}
if ((param_3 != (Vector *)0x0) &&
(((SetAbsVelocity(this,param_3), vec3_origin != *(float *)(this + 0x268) ||
(DAT_01053d4c != *(float *)(this + 0x26c))) ||
(DAT_01053d50 != *(float *)(this + 0x270))))) {
(**(code **)(*(int *)this + 0x2fc))(this,this + 0x268);
fVar8 = DAT_01053d4c;
*(float *)(this + 0x268) = vec3_origin;
fVar9 = DAT_01053d50;
*(float *)(this + 0x26c) = fVar8;
*(float *)(this + 0x270) = fVar9;
}
if (param_1 == (Vector *)0x0) goto LAB_00615380;
AddEffects(this,8);
UTIL_SetOrigin(this,param_1,false);
piVar15 = *(int **)(this_01 + 0x238);
if (piVar15 != (int *)0x0) goto LAB_0061538e;
LAB_006155f1:
local_81 = 0;
}
else {
CalcAbsolutePosition(this_01);
LAB_00615380:
piVar15 = *(int **)(this_01 + 0x238);
if (piVar15 == (int *)0x0) goto LAB_006155f1;
LAB_0061538e:
if (param_3 != (Vector *)0x0) {
(**(code **)(*piVar15 + 0xcc))(piVar15,param_3,0);
}
if (((byte)this_01[0x14d] & 8) != 0) {
CalcAbsolutePosition(this_01);
}
cVar10 = (**(code **)(*(int *)this_01 + 0x16c))(this_01);
if ((cVar10 == '\0') &&
(iVar16 = (**(code **)(*(int *)(this_01 + 0x194) + 0x2c))(this_00), iVar16 != 2)) {
local_8c = this_01 + 0x37c;
local_81 = 1;
}
else {
local_8c = (CBaseEntity *)&vec3_angle;
local_81 = 0;
}
pcVar7 = *(code **)(*piVar15 + 0xbc);
if (((byte)this_01[0x14d] & 8) != 0) {
CalcAbsolutePosition(this_01);
}
(*pcVar7)(piVar15,this_01 + 0x2e0,local_8c,1);
}
local_20 = local_81;
local_50 = &local_38;
local_38 = pCVar1;
local_34 = uVar2;
local_30 = uVar3;
local_2c = uVar4;
local_28 = uVar5;
local_24 = uVar6;
(**(code **)(*(int *)g_pNotify + 0xc))(g_pNotify,this_01,0,&local_50);
CCollisionProperty::SetSolidFlags(this_00,iVar13);
local_60 = local_60 + 1;
} while (local_60 < local_4c[3]);
if (0 < local_4c[3]) {
iVar13 = 0;
iVar16 = 0;
do {
CollisionRulesChanged(SUB41(*(undefined4 *)(local_4c[0] + iVar16),0));
iVar13 = iVar13 + 1;
iVar16 = iVar16 + 0x1c;
} while (iVar13 < local_4c[3]);
}
}
iVar13 = DAT_00fc0d14;
if ((0 < DAT_00fc0d14) && (iVar13 = DAT_00fc0d14 + -1, iVar11 != iVar13)) {
g_TeleportStack[iVar11] = g_TeleportStack[iVar13];
iVar13 = DAT_00fc0d14 + -1;
}
DAT_00fc0d14 = iVar13;
pvVar14 = (void *)GetDataObject(this,2);
if (pvVar14 != (void *)0x0) {
_V_memset(pvVar14,0,0xac);
}
local_4c[3] = 0;
CUtlMemory<TeleportListEntry_t,int>::Purge((CUtlMemory<TeleportListEntry_t,int> *)local_4c);
local_4c[4] = local_4c[0];
CUtlMemory<TeleportListEntry_t,int>::Purge((CUtlMemory<TeleportListEntry_t,int> *)local_4c);
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.