Fixed placement of oil patch and platform in editor

This commit is contained in:
jsalmon3 2002-06-17 20:34:15 +00:00
parent 6655d28888
commit fe712e87c8

View file

@ -2169,13 +2169,18 @@ global int CanBuildHere(const UnitType* type,unsigned x,unsigned y)
if( y+type->TileHeight>TheMap.Height ) {
return 0;
}
//
// Flyers and naval units can only placed on odd tiles in editor
//
if( EditorRunning &&
(type->UnitType==UnitTypeFly || type->UnitType==UnitTypeNaval) ) {
if( x&1 || y&1 ) {
return 0;
if( EditorRunning ) {
if( type->OilPatch || type->GivesOil ) {
// Oil patches and platforms can only be placed on even tiles
if( !(x&1 && y&1) ) {
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 ) {
return 0;
}
}
}