Can repair ally buildings

This commit is contained in:
jsalmon3 2003-01-25 04:01:32 +00:00
parent dafea188c9
commit fdac23c7d0

View file

@ -272,7 +272,8 @@ global void DoRightButton(int sx,int sy)
// cade: this is default repair action
dest=RepairableOnScreenMapPosition(sx, sy);
if( dest && dest->Type && dest->Player==ThisPlayer ) {
if( dest && dest->Type && (dest->Player==ThisPlayer
|| IsAllied(ThisPlayer,dest)) ) {
SendCommandRepair(unit,x,y,dest,flush);
continue;
}
@ -795,7 +796,8 @@ local void SendRepair(int sx,int sy)
int y;
dest=RepairableOnScreenMapPosition(sx,sy);
if( !dest || !dest->Type || dest->Player!=ThisPlayer ) {
if( !(dest && dest->Type && (dest->Player==ThisPlayer
|| IsAllied(ThisPlayer,dest))) ) {
// FIXME: Should move test in repairable
dest=NoUnitP;
}