Feat Req. $target(direction)
Posted: Sat Nov 08, 2003 10:32 pm
would like to have this CVS'd. it'll return a direction like NWN, E, etc. when $target(direction) is used. This would be wonderfull for the new UI labels. I would love having the direction of your target in whatever.
Code: Select all
// $target(direction)
} else if (!strncmp("target(direction)",szVar,17)) {
i+=16;
CHAR szTemp[MAX_STRING] = {0};
INT Angle = (INT)((atan2f(pChar->X - pTarget->X, pChar->Y - pTarget->Y) * 180.0f / PI + 360.0f) / 22.5f + 0.5f) % 16;
sprintf(szTemp,szHeadingShort[Angle]);
strcat(szOutput,szTemp);
}