Add more path structs.

Add getlinkednodes method for a node. getnodenumber method. getnodebynumber function. generatepath function.
This commit is contained in:
JezuzLizard
2023-03-25 19:06:45 -07:00
parent ffdf2c48ba
commit bb8233cf86
5 changed files with 143 additions and 13 deletions

View File

@@ -282,11 +282,8 @@ namespace game
void Scr_AddPathnode(scriptInstance_t inst, pathnode_t* node)
{
printf("Scr_AddPathnode Targetname %s\n", SL_ConvertToString(game::SCRIPTINSTANCE_SERVER, node->constant.targetname));
int entnum = node - (*gameWorldCurrent)->path.nodes;
printf("1 entnum: %d\n", entnum);
int entid = Scr_GetEntityId(inst, entnum, CLASS_NUM_PATHNODE, 0);
printf("2 entid: %d\n", entid);
Scr_AddEntityNum(inst, entid);
}
@@ -380,6 +377,26 @@ namespace game
return Dvar_RegisterVariant(name, game::DVAR_TYPE_STRING, flags, dvar_value, limits, desc);
}
int Path_FindPath(path_t* pPath, team_t eTeam, float* vStartPos, float* vGoalPos, int bAllowNegotiationLinks)
{
static const auto call_addr = SELECT(0x0, 0x4CF280);
int answer;
__asm
{
push bAllowNegotiationLinks;
push vGoalPos;
push vStartPos;
mov edx, eTeam;
mov ecx, pPath;
call call_addr;
mov answer, eax;
}
return answer;
}
namespace plutonium
{
}