CDirectorChallengeMode::ScriptAllowDamage
0x0089f140 · 1452 bytes · __thiscall
_ZN22CDirectorChallengeMode17ScriptAllowDamageEP11CBaseEntityR15CTakeDamageInfo
Decompiled
undefined (3 params)
/* CDirectorChallengeMode::ScriptAllowDamage(CBaseEntity*, CTakeDamageInfo&) */
uint __thiscall
CDirectorChallengeMode::ScriptAllowDamage
(CDirectorChallengeMode *this,CBaseEntity *param_1,CTakeDamageInfo *param_2)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
code *pcVar4;
char cVar5;
void *pvVar6;
undefined4 *puVar7;
int iVar8;
uint uVar9;
int *piVar10;
undefined *puVar11;
undefined4 *local_40;
undefined4 local_3c;
undefined2 local_38;
ushort local_36;
void *local_34;
undefined4 local_30;
undefined2 local_2c;
ushort local_2a;
void *local_28;
undefined4 local_24;
short local_20;
ushort local_1e;
if (0xfffffffd < *(int *)(this + 0x11c) - 1U) {
return 1;
}
local_40 = (undefined4 *)0x0;
local_38 = 3;
local_3c = 0;
uVar1 = *(undefined4 *)(param_2 + 0xc);
uVar2 = *(undefined4 *)(param_2 + 0x14);
uVar3 = *(undefined4 *)(param_2 + 0x10);
local_40 = malloc(0xc);
piVar10 = g_pScriptVM;
local_40[2] = uVar2;
local_40[1] = uVar3;
puVar11 = g_pEntityList;
local_36 = 1;
*local_40 = uVar1;
pcVar4 = *(code **)(*piVar10 + 0x78);
uVar9 = *(uint *)(param_2 + 0x30);
if (((uVar9 == 0xffffffff) ||
(puVar11 = puVar11 + (uVar9 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar11 + 8) != uVar9 >> 0xc)) {
local_28 = (void *)0x0;
}
else {
local_28 = (void *)0x0;
if (*(CBaseEntity **)(puVar11 + 4) != (CBaseEntity *)0x0) {
local_28 = (void *)CBaseEntity::GetScriptInstance(*(CBaseEntity **)(puVar11 + 4));
piVar10 = g_pScriptVM;
}
}
local_20 = 0x20;
local_1e = 0;
/* try { // try from 0089f22d to 0089f22e has its CatchHandler @ 0089f736 */
(*pcVar4)(piVar10,*(undefined4 *)(this + 0x120),"Inflictor",&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
pcVar4 = *(code **)(*g_pScriptVM + 0x78);
uVar9 = *(uint *)(param_2 + 0x34);
if (((uVar9 == 0xffffffff) ||
(puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar11 + 8) != uVar9 >> 0xc)) {
pvVar6 = (void *)0x0;
}
else {
pvVar6 = (void *)0x0;
if (*(CBaseEntity **)(puVar11 + 4) != (CBaseEntity *)0x0) {
pvVar6 = (void *)CBaseEntity::GetScriptInstance(*(CBaseEntity **)(puVar11 + 4));
}
}
local_20 = 0x20;
local_1e = 0;
local_28 = pvVar6;
/* try { // try from 0089f2b0 to 0089f2b1 has its CatchHandler @ 0089f748 */
(*pcVar4)(g_pScriptVM,*(undefined4 *)(this + 0x120),"Attacker",&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
pcVar4 = *(code **)(*g_pScriptVM + 0x78);
if (param_1 == (CBaseEntity *)0x0) {
local_28 = (void *)0x0;
}
else {
/* try { // try from 0089f2e4 to 0089f2e8 has its CatchHandler @ 0089f76b */
local_28 = (void *)CBaseEntity::GetScriptInstance(param_1);
}
local_20 = 0x20;
local_1e = 0;
/* try { // try from 0089f31a to 0089f31b has its CatchHandler @ 0089f752 */
(*pcVar4)(g_pScriptVM,*(undefined4 *)(this + 0x120),"Victim",&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
local_28 = *(void **)(param_2 + 0x3c);
local_20 = 1;
local_1e = 0;
/* try { // try from 0089f36c to 0089f36d has its CatchHandler @ 0089f754 */
(**(code **)(*g_pScriptVM + 0x78))
(g_pScriptVM,*(undefined4 *)(this + 0x120),"DamageDone",&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
local_28 = *(void **)(param_2 + 0x48);
local_20 = 5;
local_1e = 0;
/* try { // try from 0089f3ba to 0089f3bb has its CatchHandler @ 0089f74c */
(**(code **)(*g_pScriptVM + 0x78))
(g_pScriptVM,*(undefined4 *)(this + 0x120),"DamageType",&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
/* try { // try from 0089f3f3 to 0089f3f5 has its CatchHandler @ 0089f76b */
(**(code **)(*g_pScriptVM + 0x78))(g_pScriptVM,*(undefined4 *)(this + 0x120),"Location",&local_40)
;
pcVar4 = *(code **)(*g_pScriptVM + 0x78);
uVar9 = *(uint *)(param_2 + 0x38);
if (((uVar9 == 0xffffffff) ||
(puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar11 + 8) != uVar9 >> 0xc)) {
pvVar6 = (void *)0x0;
}
else {
pvVar6 = (void *)0x0;
if (*(CBaseEntity **)(puVar11 + 4) != (CBaseEntity *)0x0) {
/* try { // try from 0089f68e to 0089f6e0 has its CatchHandler @ 0089f76b */
pvVar6 = (void *)CBaseEntity::GetScriptInstance(*(CBaseEntity **)(puVar11 + 4));
}
}
local_20 = 0x20;
local_1e = 0;
local_28 = pvVar6;
/* try { // try from 0089f465 to 0089f466 has its CatchHandler @ 0089f756 */
(*pcVar4)(g_pScriptVM,*(undefined4 *)(this + 0x120),"Weapon",&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
pvVar6 = *(void **)(this + 0x120);
local_2a = 0;
uVar1 = *(undefined4 *)(this + 0x11c);
local_2c = 0;
local_34 = (void *)0x0;
/* try { // try from 0089f4b0 to 0089f4b4 has its CatchHandler @ 0089f767 */
puVar7 = (undefined4 *)CDirector::GetScriptScope(TheDirector,3);
local_24 = 0;
local_1e = 0;
local_20 = 0x20;
/* try { // try from 0089f501 to 0089f503 has its CatchHandler @ 0089f74a */
local_28 = pvVar6;
iVar8 = (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,uVar1,&local_28,1,&local_34,*puVar7,1);
if ((local_1e & 1) != 0) {
free(local_28);
}
if (iVar8 == 0) {
uVar9 = (uint)local_34 & 0xff;
if ((char)local_34 == '\0') {
if ((local_2a & 1) != 0) {
free(local_34);
local_2a = local_2a & 0xfffe;
}
local_34 = (void *)0x0;
local_30 = 0;
local_2c = 0;
if ((local_36 & 1) == 0) {
return uVar9;
}
free(local_40);
return uVar9;
}
local_28 = (void *)0x0;
local_20 = 0;
local_1e = 0;
/* try { // try from 0089f562 to 0089f5af has its CatchHandler @ 0089f711 */
cVar5 = (**(code **)(*g_pScriptVM + 0x90))
(g_pScriptVM,*(undefined4 *)(this + 0x120),"DamageDone",&local_28);
if (cVar5 != '\0') {
pvVar6 = local_28;
if (local_20 != 1) {
pvVar6 = (void *)(float)(int)local_28;
}
*(void **)(param_2 + 0x3c) = pvVar6;
}
cVar5 = (**(code **)(*g_pScriptVM + 0x90))
(g_pScriptVM,*(undefined4 *)(this + 0x120),"DamageType",&local_28);
if (cVar5 != '\0') {
pvVar6 = (void *)(int)(float)local_28;
if (local_20 == 5) {
pvVar6 = local_28;
}
*(void **)(param_2 + 0x48) = pvVar6;
}
if ((local_1e & 1) != 0) {
free(local_28);
}
}
else {
/* try { // try from 0089f6f7 to 0089f6fb has its CatchHandler @ 0089f767 */
DevWarning("Failed to call AllowTakeDamage though we think we have one!\n");
}
if ((local_2a & 1) != 0) {
free(local_34);
local_2a = local_2a & 0xfffe;
}
local_34 = (void *)0x0;
local_30 = 0;
local_2c = 0;
if ((local_36 & 1) != 0) {
free(local_40);
}
return 1;
}
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.