nb_move_to_position
0x00751820 · 725 bytes · __cdecl
_ZL19nb_move_to_positionRK8CCommand
Decompiled
undefined (1 param)
/* nb_move_to_position(CCommand const&) */
void nb_move_to_position(CCommand *param_1)
{
undefined4 *puVar1;
INextBot *pIVar2;
char cVar3;
CBasePlayer *pCVar4;
int iVar5;
NextBotManager *this;
char *pcVar6;
int iVar7;
uint uVar8;
double dVar9;
double dVar10;
double local_5c;
double local_54;
float local_38;
float local_34;
float local_30;
char local_2c;
float local_28;
float local_24;
float local_20;
cVar3 = UTIL_IsCommandIssuedByServerAdmin();
if (cVar3 != '\0') {
pCVar4 = (CBasePlayer *)UTIL_GetCommandClient();
if (pCVar4 != (CBasePlayer *)0x0) {
cVar3 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4);
if (cVar3 != '\0') {
iVar5 = *(int *)param_1;
if (1 < iVar5) {
dVar9 = strtod(*(char **)(param_1 + 0x40c),(char **)0x0);
if (iVar5 == 2) {
local_34 = 0.0;
local_54 = 0.0;
local_5c = 0.0;
local_30 = local_34;
}
else {
pcVar6 = "";
if (2 < *(int *)param_1) {
pcVar6 = *(char **)(param_1 + 0x410);
}
dVar10 = strtod(pcVar6,(char **)0x0);
local_34 = (float)dVar10;
if (iVar5 == 3) {
local_54 = (double)local_34;
local_30 = 0.0;
local_5c = 0.0;
}
else {
pcVar6 = "";
if (3 < *(int *)param_1) {
pcVar6 = *(char **)(param_1 + 0x414);
}
dVar10 = strtod(pcVar6,(char **)0x0);
local_54 = (double)local_34;
local_30 = (float)dVar10;
local_5c = (double)local_30;
}
}
local_2c = 0;
local_38 = (float)dVar9;
NDebugOverlay::Cross3D((Vector *)&local_38,5.0,0,0xff,0,true,10.0);
local_2c = '\x01';
local_28 = local_38;
local_24 = local_34;
local_20 = local_30;
iVar5 = TheNextBots();
uVar8 = (uint)*(ushort *)(iVar5 + 0x10);
if (uVar8 != 0xffff) {
iVar7 = *(int *)(iVar5 + 4);
do {
while( true ) {
puVar1 = (undefined4 *)(iVar7 + uVar8 * 8);
pIVar2 = (INextBot *)*puVar1;
if (local_2c == '\0') break;
this = (NextBotManager *)TheNextBots();
cVar3 = NextBotManager::IsDebugFilterMatch(this,pIVar2);
if (cVar3 != '\0') {
(**(code **)(*(int *)pIVar2 + 0x8c))(pIVar2,&local_28);
}
iVar7 = *(int *)(iVar5 + 4);
uVar8 = (uint)*(ushort *)(iVar7 + uVar8 * 8 + 6);
if (uVar8 == 0xffff) goto LAB_007519a3;
}
uVar8 = (uint)*(ushort *)((int)puVar1 + 6);
} while (uVar8 != 0xffff);
}
LAB_007519a3:
pcVar6 = (char *)UTIL_VarArgs("Instructed NextBots to move to %f, %f, %f.\n",
(double)(float)dVar9,local_54,local_5c);
ClientPrint(pCVar4,2,pcVar6,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
return;
}
ClientPrint(pCVar4,2,"Please specify coordinates: x y z\n",(char *)0x0,(char *)0x0,
(char *)0x0,(char *)0x0);
}
}
}
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.