mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-17 02:58:46 +02:00
Removed legacy AAS from Doom, cleaned up naming.
This commit is contained in:
+19
-19
@@ -30,10 +30,10 @@ If you have questions concerning this license or the applicable additional terms
|
||||
#pragma hdrstop
|
||||
|
||||
#include "../Game_local.h"
|
||||
#include "AASCallback_AvoidLocation.h"
|
||||
#include "AASCallback_FindAreaOutOfRange.h"
|
||||
#include "AASCallback_FindAttackPosition.h"
|
||||
#include "AASCallback_FindCoverArea.h"
|
||||
#include "NAVCallback_AvoidLocation.h"
|
||||
#include "NAVCallback_FindAreaOutOfRange.h"
|
||||
#include "NAVCallback_FindAttackPosition.h"
|
||||
#include "NAVCallback_FindCoverArea.h"
|
||||
|
||||
static const char* moveCommandString[NUM_MOVE_COMMANDS] = {
|
||||
"MOVE_NONE",
|
||||
@@ -533,11 +533,11 @@ void idAI::Restore(idRestoreGame* savefile) {
|
||||
|
||||
savefile->ReadBool(restorePhysics);
|
||||
|
||||
// Set the AAS if the character has the correct gravity vector
|
||||
// Set the NAV if the character has the correct gravity vector
|
||||
idVec3 gravity = spawnArgs.GetVector("gravityDir", "0 0 -1");
|
||||
gravity *= g_gravity.GetFloat();
|
||||
if (gravity == gameLocal.GetGravity()) {
|
||||
SetAAS();
|
||||
SetNAV();
|
||||
}
|
||||
|
||||
SetCombatModel();
|
||||
@@ -743,7 +743,7 @@ void idAI::Spawn(void) {
|
||||
|
||||
move.blockTime = 0;
|
||||
|
||||
SetAAS();
|
||||
SetNAV();
|
||||
|
||||
projectile = NULL;
|
||||
projectileDef = NULL;
|
||||
@@ -1030,7 +1030,7 @@ void idAI::Think(void) {
|
||||
}
|
||||
/* this still draws in retail builds.. not sure why.. don't care at this point.
|
||||
if ( !aas && developer.GetBool() && !fl.hidden && !num_cinematics ) {
|
||||
gameRenderWorld->DrawText( "No AAS", physicsObj.GetAbsBounds().GetCenter(), 0.1f, colorWhite, gameLocal.GetLocalPlayer()->viewAngles.ToMat3(), 1, gameLocal.msec );
|
||||
gameRenderWorld->DrawText( "No NAV", physicsObj.GetAbsBounds().GetCenter(), 0.1f, colorWhite, gameLocal.GetLocalPlayer()->viewAngles.ToMat3(), 1, gameLocal.msec );
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1180,14 +1180,14 @@ bool ValidForBounds(const idAASSettings* settings, const idBounds& bounds) {
|
||||
|
||||
/*
|
||||
=====================
|
||||
idAI::SetAAS
|
||||
idAI::SetNAV
|
||||
=====================
|
||||
*/
|
||||
void idAI::SetAAS(void) {
|
||||
void idAI::SetNAV(void) {
|
||||
idStr use_aas;
|
||||
|
||||
spawnArgs.GetString("use_aas", NULL, use_aas);
|
||||
aas = gameLocal.GetAAS(use_aas);
|
||||
aas = gameLocal.GetNAV(use_aas);
|
||||
if (aas) {
|
||||
const idAASSettings* settings = aas->GetSettings();
|
||||
if (settings) {
|
||||
@@ -1202,7 +1202,7 @@ void idAI::SetAAS(void) {
|
||||
aas = NULL;
|
||||
}
|
||||
}
|
||||
gameLocal.Printf("WARNING: %s has no AAS file\n", name.c_str());
|
||||
gameLocal.Printf("WARNING: %s has no NAV file\n", name.c_str());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1317,7 +1317,7 @@ bool idAI::PathToGoal(aasPath_t& path, int areaNum, const idVec3& origin, int go
|
||||
=====================
|
||||
idAI::TravelDistance
|
||||
|
||||
Returns the approximate travel distance from one position to the goal, or if no AAS, the straight line distance.
|
||||
Returns the approximate travel distance from one position to the goal, or if no NAV, the straight line distance.
|
||||
|
||||
This is feakin' slow, so it's not good to do it too many times per frame. It also is slower the further you
|
||||
are from the goal, so try to break the goals up into shorter distances.
|
||||
@@ -1695,7 +1695,7 @@ bool idAI::MoveOutOfRange(idEntity* ent, float range) {
|
||||
pos = ent->GetPhysics()->GetOrigin();
|
||||
}
|
||||
|
||||
idAASCallback_FindAreaOutOfRange findGoal(pos, range);
|
||||
idNAVCallback_FindAreaOutOfRange findGoal(pos, range);
|
||||
if (!aas->FindNearestGoal(goal, areaNum, org, pos, travelFlags, &obstacle, 1, findGoal)) {
|
||||
StopMove(MOVE_STATUS_DEST_UNREACHABLE);
|
||||
AI_DEST_UNREACHABLE = true;
|
||||
@@ -1753,7 +1753,7 @@ bool idAI::MoveToAttackPosition(idEntity* ent, int attack_anim) {
|
||||
pos = ent->GetPhysics()->GetOrigin();
|
||||
}
|
||||
|
||||
idAASFindAttackPosition findGoal(this, physicsObj.GetGravityAxis(), ent, pos, missileLaunchOffset[attack_anim]);
|
||||
idNAVFindAttackPosition findGoal(this, physicsObj.GetGravityAxis(), ent, pos, missileLaunchOffset[attack_anim]);
|
||||
if (!aas->FindNearestGoal(goal, areaNum, org, pos, travelFlags, &obstacle, 1, findGoal)) {
|
||||
StopMove(MOVE_STATUS_DEST_UNREACHABLE);
|
||||
AI_DEST_UNREACHABLE = true;
|
||||
@@ -1846,7 +1846,7 @@ bool idAI::MoveToCover(idEntity* entity, const idVec3& hideFromPos) {
|
||||
// consider the entity the monster tries to hide from as an obstacle
|
||||
obstacle.absBounds = entity->GetPhysics()->GetAbsBounds();
|
||||
|
||||
idAASCallback_FindCoverArea findCover(hideFromPos);
|
||||
idNAVCallback_FindCoverArea findCover(hideFromPos);
|
||||
if (!aas->FindNearestGoal(hideGoal, areaNum, org, hideFromPos, travelFlags, &obstacle, 1, findCover)) {
|
||||
StopMove(MOVE_STATUS_DEST_UNREACHABLE);
|
||||
AI_DEST_UNREACHABLE = true;
|
||||
@@ -3647,7 +3647,7 @@ void idAI::SetEnemyPosition(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
// when we don't have an AAS, we can't tell if an enemy is reachable or not,
|
||||
// when we don't have a NAV, we can't tell if an enemy is reachable or not,
|
||||
// so just assume that he is.
|
||||
if (!aas) {
|
||||
lastVisibleReachableEnemyPos = lastVisibleEnemyPos;
|
||||
@@ -3739,7 +3739,7 @@ void idAI::UpdateEnemyPosition(void) {
|
||||
}
|
||||
|
||||
if (onGround) {
|
||||
// when we don't have an AAS, we can't tell if an enemy is reachable or not,
|
||||
// when we don't have a NAV, we can't tell if an enemy is reachable or not,
|
||||
// so just assume that he is.
|
||||
if (!aas) {
|
||||
enemyAreaNum = 0;
|
||||
@@ -3808,7 +3808,7 @@ void idAI::SetEnemy(idActor* newEnemy) {
|
||||
return;
|
||||
}
|
||||
// let the monster know where the enemy is
|
||||
newEnemy->GetAASLocation(aas, lastReachableEnemyPos, enemyAreaNum);
|
||||
newEnemy->GetNAVLocation(aas, lastReachableEnemyPos, enemyAreaNum);
|
||||
SetEnemyPosition();
|
||||
SetChatSound();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user