From c3ac6a5d1f64e56d2475afc1c3f91a3ad54eac40 Mon Sep 17 00:00:00 2001 From: Wanne Date: Sat, 8 Dec 2012 22:05:20 +0000 Subject: [PATCH] - Added an ini option (ALL_NAMED_NPCS_DECIDE_ACTION) which enables proper realtime decision making for any named NPC (i.e. NPCs tied to a profile). As a result such NPCs are not required to be in CIV_TEAM anymore. (by Realist) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5720 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 4 ++++ GameSettings.h | 1 + TacticalAI/DecideAction.cpp | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 417c9e625..fe1afbb84 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1289,6 +1289,10 @@ void LoadGameExternalOptions() gGameExternalOptions.fNoEnemyAutoReadyWeapon = iniReader.ReadInteger("Tactical Gameplay Settings", "NO_ENEMY_AUTOMATIC_WEAPON_READYING", 1, 0, 2); + + // enable schedules and decision making for any named npc regardless of their team + gGameExternalOptions.fAllNamedNpcsDecideAction = iniReader.ReadBoolean("Tactical Gameplay Settings", "ALL_NAMED_NPCS_DECIDE_ACTION", FALSE); + //################# Tactical Cover System Settings ################## // CPT: Cover System Settings diff --git a/GameSettings.h b/GameSettings.h index eb7004c09..3ca503ff5 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -344,6 +344,7 @@ typedef struct BOOLEAN fAllowInstantInterruptsOnSight; BOOLEAN fNoEnemyAutoReadyWeapon; + BOOLEAN fAllNamedNpcsDecideAction; UINT16 usAwardSpecialExpForQuests; diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index 05ababce2..b55d0a669 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -813,7 +813,7 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier) // if real-time, and not in the way, do nothing 90% of the time (for GUARDS!) // unless in water (could've started there), then we better swim to shore! - if (fCivilian) + if (fCivilian || (gGameExternalOptions.fAllNamedNpcsDecideAction && pSoldier->ubProfile != NO_PROFILE)) { // special stuff for civs @@ -1427,7 +1427,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier) return( ZombieDecideActionYellow(pSoldier) ); #endif - if (fCivilian) + if (fCivilian || (gGameExternalOptions.fAllNamedNpcsDecideAction && pSoldier->ubProfile != NO_PROFILE)) { if (pSoldier->flags.uiStatusFlags & SOLDIER_COWERING) {