mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Add pathfinding interfaces, still heavily wip
This commit is contained in:
@@ -5886,43 +5886,6 @@ XS(XS_Mob_CalculateNewPosition)
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Mob_CalculateNewPosition2); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Mob_CalculateNewPosition2)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items < 5 || items > 6)
|
||||
Perl_croak(aTHX_ "Usage: Mob::CalculateNewPosition2(THIS, x, y, z, speed, checkZ= false)");
|
||||
{
|
||||
Mob * THIS;
|
||||
bool RETVAL;
|
||||
float x = (float)SvNV(ST(1));
|
||||
float y = (float)SvNV(ST(2));
|
||||
float z = (float)SvNV(ST(3));
|
||||
float speed = (float)SvNV(ST(4));
|
||||
bool checkZ;
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Mob *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Mob");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
if (items < 6)
|
||||
checkZ = false;
|
||||
else {
|
||||
checkZ = (bool)SvTRUE(ST(5));
|
||||
}
|
||||
|
||||
RETVAL = THIS->CalculateNewPosition2(x, y, z, speed, checkZ);
|
||||
ST(0) = boolSV(RETVAL);
|
||||
sv_2mortal(ST(0));
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Mob_CalculateDistance); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Mob_CalculateDistance)
|
||||
{
|
||||
@@ -9262,7 +9225,6 @@ XS(boot_Mob)
|
||||
newXSproto(strcpy(buf, "CheckAggro"), XS_Mob_CheckAggro, file, "$$");
|
||||
newXSproto(strcpy(buf, "CalculateHeadingToTarget"), XS_Mob_CalculateHeadingToTarget, file, "$$$");
|
||||
newXSproto(strcpy(buf, "CalculateNewPosition"), XS_Mob_CalculateNewPosition, file, "$$$$$;$");
|
||||
newXSproto(strcpy(buf, "CalculateNewPosition2"), XS_Mob_CalculateNewPosition2, file, "$$$$$;$");
|
||||
newXSproto(strcpy(buf, "CalculateDistance"), XS_Mob_CalculateDistance, file, "$$$$");
|
||||
newXSproto(strcpy(buf, "SendTo"), XS_Mob_SendTo, file, "$$$$");
|
||||
newXSproto(strcpy(buf, "SendToFixZ"), XS_Mob_SendToFixZ, file, "$$$$");
|
||||
|
||||
Reference in New Issue
Block a user