mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Added 'Ctrl' hotkey to add/remove 5 militia when assigning militia (by Buggler)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6347 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -5392,8 +5392,12 @@ BOOLEAN PickUpATownPersonFromSector( UINT8 ubType, INT16 sX, INT16 sY )
|
|||||||
|
|
||||||
// the number of units transferred
|
// the number of units transferred
|
||||||
INT16 countMovedCivs = 1;
|
INT16 countMovedCivs = 1;
|
||||||
|
// all units in sector
|
||||||
if (_KeyDown(SHIFT))
|
if (_KeyDown(SHIFT))
|
||||||
countMovedCivs = SectorInfo[ SECTOR( sX, sY )].ubNumberOfCivsAtLevel[ ubType ];
|
countMovedCivs = SectorInfo[ SECTOR( sX, sY )].ubNumberOfCivsAtLevel[ ubType ];
|
||||||
|
// 5 units in sector
|
||||||
|
else if (_KeyDown(CTRL))
|
||||||
|
countMovedCivs = min(5, SectorInfo[ SECTOR( sX, sY )].ubNumberOfCivsAtLevel[ ubType ]);
|
||||||
|
|
||||||
// otherwise pick this guy up
|
// otherwise pick this guy up
|
||||||
switch( ubType )
|
switch( ubType )
|
||||||
@@ -5459,6 +5463,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2");
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// drop max allowable units
|
||||||
if (_KeyDown(SHIFT))
|
if (_KeyDown(SHIFT))
|
||||||
{
|
{
|
||||||
if (countFreeCivPlace <= sGreensOnCursor)
|
if (countFreeCivPlace <= sGreensOnCursor)
|
||||||
@@ -5466,7 +5471,14 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2");
|
|||||||
else
|
else
|
||||||
countMovedCivs = sGreensOnCursor;
|
countMovedCivs = sGreensOnCursor;
|
||||||
}
|
}
|
||||||
|
// drop 5 units
|
||||||
|
else if (_KeyDown(CTRL))
|
||||||
|
{
|
||||||
|
if (countFreeCivPlace <= 5)
|
||||||
|
countMovedCivs = min(countFreeCivPlace, sGreensOnCursor);
|
||||||
|
else
|
||||||
|
countMovedCivs = min(5, sGreensOnCursor);
|
||||||
|
}
|
||||||
sGreensOnCursor -= countMovedCivs;
|
sGreensOnCursor -= countMovedCivs;
|
||||||
break;
|
break;
|
||||||
case( REGULAR_MILITIA ):
|
case( REGULAR_MILITIA ):
|
||||||
@@ -5475,10 +5487,21 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2");
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// drop max allowable units
|
||||||
if (_KeyDown(SHIFT))
|
if (_KeyDown(SHIFT))
|
||||||
{
|
{
|
||||||
if (countFreeCivPlace <= sRegularsOnCursor) countMovedCivs = countFreeCivPlace;
|
if (countFreeCivPlace <= sRegularsOnCursor)
|
||||||
else countMovedCivs = sRegularsOnCursor;
|
countMovedCivs = countFreeCivPlace;
|
||||||
|
else
|
||||||
|
countMovedCivs = sRegularsOnCursor;
|
||||||
|
}
|
||||||
|
// drop 5 units
|
||||||
|
else if (_KeyDown(CTRL))
|
||||||
|
{
|
||||||
|
if (countFreeCivPlace <= 5)
|
||||||
|
countMovedCivs = min(countFreeCivPlace, sRegularsOnCursor);
|
||||||
|
else
|
||||||
|
countMovedCivs = min(5, sRegularsOnCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
sRegularsOnCursor -= countMovedCivs;
|
sRegularsOnCursor -= countMovedCivs;
|
||||||
@@ -5489,10 +5512,21 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2");
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// drop max allowable units
|
||||||
if (_KeyDown(SHIFT))
|
if (_KeyDown(SHIFT))
|
||||||
{
|
{
|
||||||
if (countFreeCivPlace <= sElitesOnCursor) countMovedCivs = countFreeCivPlace;
|
if (countFreeCivPlace <= sElitesOnCursor)
|
||||||
else countMovedCivs = sElitesOnCursor;
|
countMovedCivs = countFreeCivPlace;
|
||||||
|
else
|
||||||
|
countMovedCivs = sElitesOnCursor;
|
||||||
|
}
|
||||||
|
// drop 5 units
|
||||||
|
else if (_KeyDown(CTRL))
|
||||||
|
{
|
||||||
|
if (countFreeCivPlace <= 5)
|
||||||
|
countMovedCivs = min(countFreeCivPlace, sElitesOnCursor);
|
||||||
|
else
|
||||||
|
countMovedCivs = min(5, sElitesOnCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
sElitesOnCursor -= countMovedCivs;
|
sElitesOnCursor -= countMovedCivs;
|
||||||
|
|||||||
Reference in New Issue
Block a user