CEnvBeam::BeamUpdateVars
0x006840f0 · 1119 bytes · __thiscall
_ZN8CEnvBeam14BeamUpdateVarsEv
Decompiled
undefined (1 param)
/* CEnvBeam::BeamUpdateVars() */
void __thiscall CEnvBeam::BeamUpdateVars(CEnvBeam *this)
{
CBaseEdict *pCVar1;
undefined1 *puVar2;
uint uVar3;
char cVar4;
char *pcVar5;
CBaseEntity *this_00;
CBaseEntity *this_01;
int iVar6;
undefined1 *puVar7;
int iVar8;
float fVar9;
pcVar5 = *(char **)(this + 0x4ec);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
this_00 = (CBaseEntity *)
CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar5,(CBaseEntity *)0x0,
(CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
pcVar5 = "";
if (*(char **)(this + 0x4f0) != (char *)0x0) {
pcVar5 = *(char **)(this + 0x4f0);
}
this_01 = (CBaseEntity *)
CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar5,(CBaseEntity *)0x0,
(CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
if (this_01 == (CBaseEntity *)0x0) {
return;
}
if (this_00 == (CBaseEntity *)0x0) {
return;
}
if (*(int *)(this + 0x450) != 2) {
if (this[0x6c] == (CEnvBeam)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x450) = 2;
}
iVar6 = *(int *)(this + 0x500);
if ((float)iVar6 <= 100.0) {
iVar8 = 0;
if (-1 < iVar6) {
iVar8 = iVar6;
}
iVar6 = (int)(float)iVar8;
}
else {
iVar6 = 100;
}
*(int *)(this + 0x500) = iVar6;
if ((this == (CEnvBeam *)this_01) && (this != (CEnvBeam *)this_00)) {
DevMsg(
"env_beams cannot have the end entity be the beam itself\nunless the start entity is also the beam itself!\n"
);
}
puVar2 = *(undefined1 **)(this + 0x508);
*(undefined1 **)(this + 0x260) = puVar2;
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
puVar7 = &DAT_00d539c2;
if (puVar2 != (undefined1 *)0x0) {
puVar7 = puVar2;
}
iVar6 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar7);
if (iVar6 != *(int *)(this + 0xf4)) {
if (this[0x6c] == (CEnvBeam)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
}
*(int *)(this + 0xf4) = iVar6;
}
(**(code **)(*(int *)this + 0x24))(this,*(undefined4 *)(this + 0x4e8));
CBeam::SetType((CBeam *)this,1);
cVar4 = IsStaticPointEntity(this_00);
if (cVar4 == '\0') {
CBeam::SetStartEntity((CBeam *)this,this_00);
cVar4 = IsStaticPointEntity(this_01);
}
else {
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
CBeam::SetAbsStartPos((CBeam *)this,(Vector *)(this_00 + 0x2e0));
cVar4 = IsStaticPointEntity(this_01);
}
if (cVar4 == '\0') {
CBeam::SetEndEntity((CBeam *)this,this_01);
}
else {
if (((byte)this_01[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_01);
}
CBeam::SetAbsEndPos((CBeam *)this,(Vector *)(this_01 + 0x2e0));
}
CBeam::RelinkBeam((CBeam *)this);
fVar9 = *(float *)(this + 0x4f8);
if (102.3 <= fVar9) {
fVar9 = 102.3;
}
if (fVar9 != *(float *)(this + 0x4b0)) {
if (this[0x6c] == (CEnvBeam)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
}
*(float *)(this + 0x4b0) = fVar9;
}
fVar9 = *(float *)(this + 0x4fc);
if (64.0 <= fVar9) {
fVar9 = 64.0;
}
if (fVar9 != *(float *)(this + 0x4c0)) {
if (this[0x6c] == (CEnvBeam)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
}
*(float *)(this + 0x4c0) = fVar9;
}
iVar6 = *(int *)(this + 0x50c);
if ((float)iVar6 != *(float *)(this + 0x4c4)) {
if (this[0x6c] == (CEnvBeam)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
}
*(float *)(this + 0x4c4) = (float)iVar6;
}
iVar6 = *(int *)(this + 0x500);
if ((float)iVar6 == *(float *)(this + 0x4c8)) {
uVar3 = *(uint *)(this + 0x148);
}
else {
if (this[0x6c] == (CEnvBeam)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
}
uVar3 = *(uint *)(this + 0x148);
*(float *)(this + 0x4c8) = (float)iVar6;
}
if ((uVar3 & 0x80) != 0) {
CBeam::SetBeamFlags((CBeam *)this,0x40);
return;
}
if ((uVar3 & 0x100) != 0) {
CBeam::SetBeamFlags((CBeam *)this,0x80);
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.