Added support for original ships/flyers movement.

This commit is contained in:
johns 2001-02-19 10:08:19 +00:00
parent e2b9627269
commit 2f934e45af

View file

@ -186,7 +186,6 @@ global void DoRightButton(int x,int y)
// Worker of human or orcs
//
if( action==MouseActionHarvest ) {
DebugLevel3("Action %x\n",TheMap.ActionMap[x+y*TheMap.Width]);
if( type==UnitTypeOrcWorkerWithWood
|| type==UnitTypeHumanWorkerWithWood
|| type==UnitTypeOrcWorkerWithGold
@ -279,6 +278,12 @@ global void DoRightButton(int x,int y)
}
}
#ifdef NEW_SHIPS
if( unit->Type->UnitType!=UnitTypeLand ) {
x&=~1;
y&=~1; // Ships could only even fields
}
#endif
SendCommandMove(unit,x,y,flush);
continue;
}
@ -315,6 +320,13 @@ global void DoRightButton(int x,int y)
}
}
#ifdef NEW_SHIPS
if( unit->Type->UnitType!=UnitTypeLand ) {
x&=~1;
y&=~1; // Ships could only even fields
}
#endif
// empty space
if( RightButtonAttacks ) {
SendCommandAttack(unit,x,y,NoUnitP,flush);
@ -331,6 +343,21 @@ global void DoRightButton(int x,int y)
if( action==MouseActionMove ) {
}
//
// Ships
//
#ifdef NEW_SHIPS
if( action==MouseActionSail ) {
x&=~1;
y&=~1; // Ships could only even fields
}
if( unit->Type->UnitType!=UnitTypeLand ) {
x&=~1;
y&=~1; // Ships could only even fields
}
#endif
// if( !unit->Type->Building ) {
SendCommandMove(unit,x,y,flush);
// }