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:
parent
d9fa95118f
commit
6a1f22268f
3 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -55,6 +55,7 @@ $]
|
|||
#define MaxResourceInfo MaxCosts + 4
|
||||
#define PlayerMax 16
|
||||
#define PlayerNumNeutral (PlayerMax - 1)
|
||||
#define InfiniteRepairRange 0x7FFFFFFF
|
||||
|
||||
#define NoButton 0
|
||||
#define LeftButton 2
|
||||
|
|
Loading…
Reference in a new issue