support building external buildings from workers with infinite range (like walls and roads built from the town hall in warcraft1)

This commit is contained in:
Tim Felgentreff 2015-09-06 12:41:41 +02:00
parent d9fa95118f
commit 6a1f22268f
3 changed files with 4 additions and 1 deletions

View file

@ -181,7 +181,8 @@ VisitResult BuildingPlaceFinder::Visit(TerrainTraversal &terrainTraversal, const
*resultPos = pos;
}
}
if (CanMoveToMask(pos, movemask)) { // reachable
if (CanMoveToMask(pos, movemask)
|| (worker.Type->RepairRange == InfiniteRepairRange && type.BuilderOutside)) { // reachable, or unit can build from outside and anywhere
return VisitResult_Ok;
} else { // unreachable
return VisitResult_DeadEnd;

View file

@ -525,6 +525,7 @@ public:
int BurnPercent; /// Burning percent.
int BurnDamageRate; /// HP burn rate per sec
int RepairRange; /// Units repair range.
#define InfiniteRepairRange INT_MAX
char *CanCastSpell; /// Unit is able to use spells.
char *AutoCastActive; /// Default value for autocast.
int AutoBuildRate; /// The rate at which the building builds itself

View file

@ -55,6 +55,7 @@ $]
#define MaxResourceInfo MaxCosts + 4
#define PlayerMax 16
#define PlayerNumNeutral (PlayerMax - 1)
#define InfiniteRepairRange 0x7FFFFFFF
#define NoButton 0
#define LeftButton 2