From 7389e26e6cdf989889182a43b653dfc463c51238 Mon Sep 17 00:00:00 2001 From: jsalmon3 <> Date: Tue, 7 Jan 2003 05:02:44 +0000 Subject: [PATCH] Don't allow oil patches placed over oil patches in the editor --- src/unit/unit.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 329bd4608..fd2bcedd5 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -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 ) {