Don't allow oil patches placed over oil patches in the editor

This commit is contained in:
jsalmon3 2003-01-07 05:02:44 +00:00
parent 134080256d
commit 7389e26e6c

View file

@ -2095,6 +2095,15 @@ global int CanBuildHere(const UnitType* type,int x,int y)
if( !(x&1 && y&1) ) {
return 0;
}
// Don't allow oil patches on oil patches
if( type->OilPatch ) {
n=UnitCacheSelect(x,y,x+type->TileWidth,y+type->TileHeight,table);
for( i=0; i<n; ++i ) {
if( table[i]->Type->OilPatch ) {
return 0;
}
}
}
} else if( type->UnitType==UnitTypeFly || type->UnitType==UnitTypeNaval ) {
// Flyers and naval units can only be placed on odd tiles
if( x&1 || y&1 ) {