added spawning

Tile test tool now spawns classes and data
Test avoidance added to aicontroller and ainavigation
This commit is contained in:
marauder2k7 2025-07-27 12:43:19 +01:00
parent a5e969a8fd
commit f730d0bf1c
8 changed files with 286 additions and 301 deletions

View file

@ -168,8 +168,19 @@ bool AIController::getAIMove(Move* movePtr)
{
obj = getAIInfo()->mObj;
}
bool adjusted = false;
if (getNav()->avoidObstacles())
{
adjusted = true;
}
else if (mRandI(0, 100) < mControllerData->mFlocking.mChance && getNav()->flock())
{
adjusted = true;
}
// Only repath if not already adjusted and on risky ground
RayInfo info;
if (obj->getContainer()->castRay(obj->getPosition(), obj->getPosition() - Point3F(0, 0, mControllerData->mHeightTolerance), StaticShapeObjectType, &info))
if (!adjusted && obj->getContainer()->castRay(obj->getPosition(), obj->getPosition() - Point3F(0, 0, mControllerData->mHeightTolerance), StaticShapeObjectType, &info))
{
getNav()->repath();
}