CGotoHideSpotSched :: CGotoHideSpotSched ( CBot *pBot, edict_t *pEdict, bool bIsGrenade ) { // run at flank while shooting CFindPathTask *pHideGoalPoint = new CFindPathTask(pEdict); pBot->setCoverFrom(pEdict); addTask(new CFindGoodHideSpot(pEdict)); addTask(pHideGoalPoint); if ( bIsGrenade ) addTask(new CDODWaitForGrenadeTask(pEdict)); // don't need to hide if the player we're hiding from died while we're running away pHideGoalPoint->failIfTaskEdictDead(); pHideGoalPoint->setLookTask(LOOK_WAYPOINT); // no interrupts, should be a quick waypoint path anyway pHideGoalPoint->setNoInterruptions(); // get vector from good hide spot task pHideGoalPoint->getPassedVector(); pHideGoalPoint->dontGoToEdict(); if ( bIsGrenade ) { pHideGoalPoint->setRange(BLAST_RADIUS+100.0f); pHideGoalPoint->completeOutOfRangeFromEdict(); } }
CBotTFEngiUpgrade :: CBotTFEngiUpgrade ( CBot *pBot, edict_t *pBuilding ) { CFindPathTask *pathtask = new CFindPathTask(pBuilding); addTask(pathtask); pathtask->completeInRangeFromEdict(); pathtask->failIfTaskEdictDead(); pathtask->setRange(150.0f); if ( !CTeamFortress2Mod::isSentryGun(pBuilding) ) { pathtask->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot)); CBotTF2UpgradeBuilding *upgbuilding = new CBotTF2UpgradeBuilding(pBuilding); addTask(upgbuilding); upgbuilding->setInterruptFunction(new CBotTF2EngineerInterrupt(pBot)); } else { addTask(new CBotTF2UpgradeBuilding(pBuilding)); } }