|
13 | 13 | #include "bot/behavior/medic/tf_bot_medic_retreat.h" |
14 | 14 | #include "bot/behavior/tf_bot_use_teleporter.h" |
15 | 15 | #include "bot/behavior/scenario/capture_the_flag/tf_bot_fetch_flag.h" |
| 16 | +#ifdef MAPBASE |
| 17 | +#include "bot/behavior/scenario/capture_point/tf_bot_capture_point.h" |
| 18 | +#include "bot/behavior/tf_bot_seek_and_destroy.h" |
| 19 | +#endif |
16 | 20 | #include "nav_mesh.h" |
17 | 21 | #include "tier0/vprof.h" |
18 | 22 |
|
@@ -272,7 +276,11 @@ CTFPlayer *CTFBotMedicHeal::SelectPatient( CTFBot *me, CTFPlayer *current ) |
272 | 276 |
|
273 | 277 | CSelectPrimaryPatient choose( me, current ); |
274 | 278 |
|
| 279 | +#ifdef MAPBASE |
| 280 | + if ( TFGameRules()->IsPVEModeActive() || TFGameRules()->IsInArenaMode() ) |
| 281 | +#else |
275 | 282 | if ( TFGameRules()->IsPVEModeActive() ) |
| 283 | +#endif |
276 | 284 | { |
277 | 285 | // assume perfect knowledge |
278 | 286 | CUtlVector< CTFPlayer * > livePlayerVector; |
@@ -518,6 +526,23 @@ ActionResult< CTFBot > CTFBotMedicHeal::Update( CTFBot *me, float interval ) |
518 | 526 | return Continue(); |
519 | 527 | } |
520 | 528 |
|
| 529 | +#ifdef MAPBASE |
| 530 | + if ( TFGameRules()->IsInArenaMode() ) |
| 531 | + { |
| 532 | + // If we can't find a patient in arena mode, we probably won't for the rest of the round |
| 533 | + // Defer to default capture AI |
| 534 | + CUtlVector< CTeamControlPoint * > captureVector; |
| 535 | + TFGameRules()->CollectCapturePoints( me, &captureVector ); |
| 536 | + |
| 537 | + if ( captureVector.Count() > 0 ) |
| 538 | + { |
| 539 | + return ChangeTo( new CTFBotCapturePoint, "Everyone is gone! Going for the point" ); |
| 540 | + } |
| 541 | + |
| 542 | + return ChangeTo( new CTFBotSeekAndDestroy, "Everyone is gone! Seeking and destroying" ); |
| 543 | + } |
| 544 | +#endif |
| 545 | + |
521 | 546 | // no patients - retreat to spawn to find another one |
522 | 547 | return SuspendFor( new CTFBotMedicRetreat, "Retreating to find another patient to heal" ); |
523 | 548 | } |
|
0 commit comments