behavioural change: feeding an AInfo an object with a 0 radius causes the class to fill in radius from that objects bounds box

also, vehicle direct hooks
This commit is contained in:
AzaezelX 2025-04-18 11:36:27 -05:00
parent 78a26b0108
commit 2d0bcbcf8d
4 changed files with 32 additions and 3 deletions

View file

@ -405,6 +405,7 @@ Vehicle::Vehicle()
mWorkingQueryBoxCountDown = sWorkingQueryBoxStaleThreshold;
mPhysicsRep = NULL;
mAIController = NULL;
}
U32 Vehicle::getCollisionMask()
@ -471,7 +472,7 @@ bool Vehicle::onAdd()
void Vehicle::onRemove()
{
SAFE_DELETE(mPhysicsRep);
if (mAIController) mAIController->deleteObject();
U32 i=0;
for( i=0; i<VehicleData::VC_NUM_DAMAGE_EMITTERS; i++ )
@ -1219,3 +1220,25 @@ void Vehicle::_renderMuzzleVector( ObjectRenderInst *ri, SceneRenderState *state
PrimBuild::end();
}
bool Vehicle::setAIController(SimObjectId controller)
{
if (Sim::findObject(controller, mAIController) && mAIController->mControllerData)
{
mAIController->setAIInfo(this);
return true;
}
Con::errorf("unable to find AIController : %i", controller);
mAIController = NULL;
return false;
}
DefineEngineMethod(Vehicle, setAIController, bool, (S32 controller), , "")
{
return object->setAIController(controller);
}
DefineEngineMethod(Vehicle, getAIController, AIController*, (), , "")
{
return object->getAIController();
}