From 4b880840d8dc26c6387d285e063beac74686f688 Mon Sep 17 00:00:00 2001 From: Gene Date: Mon, 24 Jun 2024 10:15:20 -0700 Subject: [PATCH] galak mech uses old nav functions --- code/game/AI_GalakBoss.cpp | 34 +++++++++++++++++----------------- code/game/b_local.h | 3 ++- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/code/game/AI_GalakBoss.cpp b/code/game/AI_GalakBoss.cpp index 5f27eeedeb..35f5dbe89d 100644 --- a/code/game/AI_GalakBoss.cpp +++ b/code/game/AI_GalakBoss.cpp @@ -387,24 +387,24 @@ static qboolean GM_Move( void ) NPCInfo->combatMove = qtrue;//always move straight toward our goal qboolean moved = NPC_MoveToGoal( qtrue ); - // navInfo_t info; - - // //Get the move info - // NAV_GetLastMove( info ); - - // //FIXME: if we bump into another one of our guys and can't get around him, just stop! - // //If we hit our target, then stop and fire! - // if ( info.flags & NIF_COLLISION ) - // { - // if ( info.blocker == NPC->enemy ) - // { - // GM_HoldPosition(); - // } - // } - if (NPCInfo->blockedEntity && NPCInfo->blockedEntity == NPC->enemy) + navInfo_t info; + + //Get the move info + NAV_GetLastMove( info ); + + //FIXME: if we bump into another one of our guys and can't get around him, just stop! + //If we hit our target, then stop and fire! + if ( info.flags & NIF_COLLISION ) { - GM_HoldPosition(); + if ( info.blocker == NPC->enemy ) + { + GM_HoldPosition(); + } } + /* if (NPCInfo->blockedEntity && NPCInfo->blockedEntity == NPC->enemy) + { + GM_HoldPosition(); + } */ //If our move failed, then reset if ( moved == qfalse ) @@ -459,7 +459,7 @@ static void GM_CheckMoveState( void ) if ( ( NPCInfo->goalEntity != NPC->enemy ) && ( NPCInfo->goalEntity != NULL ) ) { //Did we make it? - if ( STEER::Reached(NPC, NPCInfo->goalEntity, 16, qfalse) || + if ( /* STEER::Reached(NPC, NPCInfo->goalEntity, 16, qfalse) */ NAV_HitNavGoal( NPC->currentOrigin, NPC->mins, NPC->maxs, NPCInfo->goalEntity->currentOrigin, 16, qfalse ) || ( !Q3_TaskIDPending( NPC, TID_MOVE_NAV ) && enemyLOS && enemyDist <= 10000 ) ) {//either hit our navgoal or our navgoal was not a crucial (scripted) one (maybe a combat point) and we're scouting and found our enemy NPC_ReachedGoal(); diff --git a/code/game/b_local.h b/code/game/b_local.h index d95c7563d9..3c2e732cc6 100644 --- a/code/game/b_local.h +++ b/code/game/b_local.h @@ -324,6 +324,7 @@ extern int NPC_FindSquadPoint( vec3_t position ); extern void ClearPlayerAlertEvents( void ); extern qboolean G_BoundsOverlap(const vec3_t mins1, const vec3_t maxs1, const vec3_t mins2, const vec3_t maxs2); +extern qboolean NAV_HitNavGoal( vec3_t point, vec3_t mins, vec3_t maxs, vec3_t dest, int radius, qboolean flying ); extern void NPC_SetMoveGoal( gentity_t *ent, vec3_t point, int radius, qboolean isNavGoal = qfalse, int combatPoint = -1, gentity_t *targetEnt = NULL ); @@ -359,7 +360,7 @@ typedef struct navInfo_s int flags; } navInfo_t; - +extern void NAV_GetLastMove( navInfo_t &info ); #endif