CGrenadeLauncher_Projectile::Create
0x0053c400 · 544 bytes · __cdecl
_ZN27CGrenadeLauncher_Projectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacteri
Decompiled
undefined (6 params)
/* CGrenadeLauncher_Projectile::Create(Vector const&, QAngle const&, Vector const&, Vector const&,
CBaseCombatCharacter*, int) */
CBaseCSGrenadeProjectile *
CGrenadeLauncher_Projectile::Create
(Vector *param_1,QAngle *param_2,Vector *param_3,Vector *param_4,
CBaseCombatCharacter *param_5,int param_6)
{
float fVar1;
code *pcVar2;
CBaseEdict *pCVar3;
CBaseCSGrenadeProjectile *this;
undefined4 uVar4;
int iVar5;
this = (CBaseCSGrenadeProjectile *)
CBaseEntity::Create("grenade_launcher_projectile",param_1,param_2,(CBaseEntity *)param_5);
UTIL_LogPrintf("CGrenadeLauncher_Projectile spawned at %f %f %f, velocity %f %f %f\n",
(double)*(float *)param_1,(double)*(float *)(param_1 + 4),
(double)*(float *)(param_1 + 8),(double)*(float *)param_3,
(double)*(float *)(param_3 + 4),(double)*(float *)(param_3 + 8));
CBaseCSGrenadeProjectile::SetDetonateTimerLength(this,1.5);
CBaseEntity::SetAbsVelocity((CBaseEntity *)this,param_3);
CBaseCSGrenadeProjectile::SetupInitialTransmittedGrenadeVelocity(this,param_3);
CBaseGrenade::SetThrower((CBaseGrenade *)this,param_5);
*(undefined4 *)(this + 0x2c0) = 0x3ecccccd;
CBaseEntity::SetFriction((CBaseEntity *)this,0.2);
if (*(float *)(this + 0x2c8) != 0.45) {
if (this[0x6c] == (CBaseCSGrenadeProjectile)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CBaseCSGrenadeProjectile)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2c8) = 0x3ee66666;
}
*(undefined4 *)(this + 0xd8) = 0x589;
uVar4 = grenadelauncher_damage._28_4_;
*(undefined4 *)(this + 0xdc) = 0;
fVar1 = *(float *)(uVar4 + 0x2c);
if (fVar1 != *(float *)(this + 0x1a50)) {
if (this[0x6c] == (CBaseCSGrenadeProjectile)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CBaseCSGrenadeProjectile)((byte)this[0x70] | 1);
}
*(float *)(this + 0x1a50) = fVar1;
}
if (*(float *)(this + 0x1a44) != 0.0) {
if (this[0x6c] == (CBaseCSGrenadeProjectile)0x0) {
pCVar3 = *(CBaseEdict **)(this + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar5 + 2) = 0;
}
*(undefined4 *)(this + 0x1a44) = 0;
}
else {
this[0x70] = (CBaseCSGrenadeProjectile)((byte)this[0x70] | 1);
*(undefined4 *)(this + 0x1a44) = 0;
}
}
pcVar2 = *(code **)(*(int *)this + 0x194);
uVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_5);
(*pcVar2)(this,uVar4);
CBaseEntity::ApplyLocalAngularVelocityImpulse((CBaseEntity *)this,param_4);
*(int *)(this + 0x1a7c) = param_6;
return this;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.