[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: next unit gameplay



Le 16/03/2014 10:43, Sébastien Dailly a écrit :
Hello,

There is a keyboard shortcut wich allow to select the next unit to play ; but once you did an action with a unit (move, attack), the next time you press the key, cf select for you the first unit in the list. This in boring if the first unit is a bunker, or a unit useless for this turn : each time you do an action, you have to skip those unit manualy, again and again.

With this patch, cf select for you the unit following the one under the cursor. It allow to chain : action - next - action - next…

It does not change the rule or the game strategy, just the gameplay.


Sorry, this patch was wrong. This is the effective patch.

--
Sébastien
--- crimson-0.5.3_orig/src/cf/game.cpp	2007-06-24 17:30:18.000000000 +0200
+++ crimson-0.5.3/src/cf/game.cpp	2014-03-16 10:58:51.000000000 +0100
@@ -1233,8 +1233,16 @@ void Game::SelectNextUnit( void ) {
   List &units = mission->GetUnits();
   Unit *start, *u;
 
-  if ( unit ) start = unit;
-  else start = static_cast<Unit *>( units.Head() );
+  if ( unit ) {
+      start = unit;
+  } else {
+    // look for any unit under the cursor
+    MapView *mv = mwin->GetMapView();
+    Point cursor = mv->Cursor();
+    Unit *u = mission->GetMap().GetUnit( cursor );
+    if (u) start = u;
+    else start = static_cast<Unit *>( units.Head() );
+  }
 
   u = static_cast<Unit *>( units.NextNode(start) );