Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » [Patch] Skip militia turns by holding SHIFT
[Patch] Skip militia turns by holding SHIFT[message #251231] Sun, 09 May 2010 15:29 Go to next message
bbun is currently offline bbun

 
Messages:74
Registered:April 2004
Location: Amsterdam
Very useful if you're in a sector under attack, and don't want the 20 militia to do anything. In addition to it taking ages, you prevent them from getting theirselves wounded or killed by instructing them to "hold position".

Will also work when militia's have begun moving already.

Index: Build/Tactical/TeamTurns.cc
===================================================================
--- Build/Tactical/TeamTurns.cc (revision 7063)
+++ Build/Tactical/TeamTurns.cc (working copy)
@@ -40,6 +40,8 @@
 #include "NPC.h"
 #include "Debug.h"
 #include "Items.h"
+#include "Input.h"
+#include "English.h"
 
 
 static SOLDIERTYPE* gOutOfTurnOrder[MAXMERCS];
@@ -285,6 +287,15 @@
 {
        while( 1 )
        {
+               if ( ubTeam == MILITIA_TEAM && _KeyDown( SHIFT ) )
+               {
+                       // player wants to skip militia turn
+                       ubTeam++;
+                       gTacticalStatus.ubCurrentTeam++;
+                       // skip back to the top, as we are processing another team now.
+                       continue;
+               }
+
                if ( ubTeam > LAST_TEAM )
                {
                        if ( HandleAirRaidEndTurn( ubTeam ) )
Index: Build/TacticalAI/AIMain.cc
===================================================================
--- Build/TacticalAI/AIMain.cc  (revision 7063)
+++ Build/TacticalAI/AIMain.cc  (working copy)
@@ -40,6 +40,8 @@
 #include "Quests.h"
 #include "Queen_Command.h"
 #include "Debug.h"
+#include "Input.h"
+#include "English.h"
 
 
 #define AI_DELAY 100
@@ -642,6 +644,14 @@
        DebugAI(String("Ending control for %d", s.ubID));
 #endif
 
+       if (s.bTeam == MILITIA_TEAM && _KeyDown( SHIFT ))
+       {
+               while ( RemoveFirstAIListEntry() )
+               {
+                       // we are simply looping through them all to empty the stack of militia AI
+               }
+       }
+
        // Find the next AI guy
        if (SOLDIERTYPE* const s = RemoveFirstAIListEntry())
        {

[Updated on: Sun, 09 May 2010 15:35] by Moderator

Report message to a moderator

Corporal
Re: [Patch] Skip militia turns by holding SHIFT[message #251254] Sun, 09 May 2010 23:24 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
I think I will try your patch to prevent the militia from shooting my mercs in the back when they rush to knock down the last enemies to steal their weapons (and increase their dexterity and strength).

Report message to a moderator

Master Sergeant
Re: [Patch] Skip militia turns by holding SHIFT[message #251579] Fri, 14 May 2010 23:07 Go to previous message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
One thing I had never paid attention to with patch content provided like that is that tabs are expanded into spaces and the GNU patch program doesn't like that at all unless it is passed a command line option to ignore them.

It may be the explanation why Centurion wasn't able to use my "clothes changes" patch.

Hosting patches as files has its problems too with the End Of Line format.

Report message to a moderator

Master Sergeant
Previous Topic: Platform independent: SLF extractor
Next Topic: [Patch] Clothes change
Goto Forum:
  


Current Time: Sat Jan 25 08:28:46 GMT+2 2025

Total time taken to generate the page: 0.00808 seconds