CCollisionProperty::SetSolid
0x0042c080 · 548 bytes · __thiscall
_ZN18CCollisionProperty8SetSolidE11SolidType_t
Decompiled
undefined (2 params)
/* CCollisionProperty::SetSolid(SolidType_t) */
void __thiscall CCollisionProperty::SetSolid(CCollisionProperty *this,uint param_2)
{
ushort uVar1;
byte bVar2;
uint uVar3;
CBaseEntity *this_00;
int *piVar4;
byte bVar5;
uint uVar6;
int iVar7;
int local_40;
int local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
int local_20;
if ((byte)this[0x22] == param_2) {
return;
}
bVar5 = 0;
uVar1 = *(ushort *)(this + 0x20);
if ((byte)this[0x22] == 0) {
MarkSurroundingBoundsDirty(this);
}
else {
MarkSurroundingBoundsDirty(this);
bVar5 = ((byte)(uVar1 >> 2) ^ 1) & 1;
}
if (param_2 != 1) goto LAB_0042c0b9;
this_00 = *(CBaseEntity **)(this + 4);
uVar6 = *(uint *)(this_00 + 0x188);
if (uVar6 != 0xffffffff) {
uVar3 = uVar6 & 0xfff;
piVar4 = (int *)(g_pEntityList + uVar3 * 0x10 + 4);
if (piVar4 != (int *)0x0) {
if ((*(uint *)(g_pEntityList + uVar3 * 0x10 + 8) == uVar6 >> 0xc) &&
(*(int *)(g_pEntityList + uVar3 * 0x10 + 4) != 0)) {
iVar7 = CBaseEntity::GetRootMoveParent(this_00);
iVar7 = (**(code **)(*(int *)(iVar7 + 0x194) + 0x2c))(iVar7 + 0x194);
this_00 = *(CBaseEntity **)(this + 4);
uVar3 = 6;
if (iVar7 == 1) {
uVar3 = param_2;
}
uVar6 = *(uint *)(this_00 + 0x188);
param_2 = uVar3;
if ((uVar6 == 0xffffffff) ||
(piVar4 = (int *)(g_pEntityList + (uVar6 & 0xfff) * 0x10 + 4), piVar4 == (int *)0x0))
goto LAB_0042c18c;
}
if ((piVar4[1] == uVar6 >> 0xc) && (*piVar4 != 0)) goto LAB_0042c0b9;
}
}
LAB_0042c18c:
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0;
/* try { // try from 0042c1b9 to 0042c1fc has its CatchHandler @ 0042c2ba */
GetAllChildren(this_00,(CUtlVector *)&local_30);
local_40 = local_24 + -1;
iVar7 = local_40 * 4;
if (-1 < local_40) {
do {
SetSolidFlags((CCollisionProperty *)(*(int *)(local_30 + iVar7) + 0x194),
(uint)(*(ushort *)(*(int *)(local_30 + iVar7) + 0x1b4) | 0x100));
local_40 = local_40 + -1;
iVar7 = iVar7 + -4;
} while (local_40 != -1);
}
local_24 = 0;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_30);
LAB_0042c0b9:
if (param_2._0_1_ != this[0x22]) {
(**(code **)(*(int *)this + 0x50))(this,this + 0x22);
this[0x22] = param_2._0_1_;
}
CBaseEntity::CollisionRulesChanged(SUB41(*(undefined4 *)(this + 4),0));
UpdateServerPartitionMask(this);
bVar2 = 0;
if (this[0x22] != (CCollisionProperty)0x0) {
bVar2 = ((byte)(*(ushort *)(this + 0x20) >> 2) ^ 1) & 1;
}
if (bVar5 != bVar2) {
CheckForUntouch(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.