# Made units that build a field start auto-gathering it. Also updated field foundation.
This was SVN commit r5347.
This commit is contained in:
parent
8bc57c24ba
commit
576a0aa421
@ -4,14 +4,14 @@
|
||||
<Traits>
|
||||
|
||||
<Id>
|
||||
<Generic>Foundation 6x6</Generic>
|
||||
<Generic>Foundation Field</Generic>
|
||||
|
||||
<Classes>Foundation</Classes>
|
||||
</Id>
|
||||
|
||||
<Footprint>
|
||||
<Width>28.0</Width>
|
||||
<Depth>28.0</Depth>
|
||||
<Width>10.0</Width>
|
||||
<Depth>10.0</Depth>
|
||||
<Height>8.0</Height>
|
||||
</Footprint>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
</Vision>
|
||||
|
||||
</Traits>
|
||||
|
||||
<Actor>structures/plot_field_fallow.xml</Actor>
|
||||
|
||||
<Actor>structures/plot_field_found.xml</Actor>
|
||||
|
||||
</Entity>
|
@ -49,6 +49,10 @@
|
||||
<Type>food</Type>
|
||||
<SubType>grain</SubType>
|
||||
</Supply>
|
||||
|
||||
<Vision>
|
||||
<Los>9</Los>
|
||||
</Vision>
|
||||
|
||||
</Traits>
|
||||
|
||||
|
@ -1090,6 +1090,13 @@ function entityEventTargetExhausted( evt )
|
||||
}
|
||||
else if( evt.action == ACTION_BUILD )
|
||||
{
|
||||
// If the target was gatherable, try to gather it.
|
||||
if( canGather(this, evt.target) )
|
||||
{
|
||||
this.order( ORDER_GENERIC, evt.target, ACTION_GATHER );
|
||||
return;
|
||||
}
|
||||
|
||||
// Look for other stuff to build
|
||||
var visible = this.getVisibleEntities();
|
||||
var bestDist = 1e20;
|
||||
@ -1110,10 +1117,12 @@ function entityEventTargetExhausted( evt )
|
||||
if( bestTarget != null )
|
||||
{
|
||||
this.order( ORDER_GENERIC, bestTarget, ACTION_BUILD );
|
||||
return;
|
||||
}
|
||||
else if( evt.target.hasClass("Village") )
|
||||
|
||||
// Nothing to build, but try to gather any resource around us if this was a village object.
|
||||
if( evt.target.hasClass("Village") )
|
||||
{
|
||||
// Nothing to build, but try to gather any resource around us
|
||||
this.chooseGatherTarget( null, evt.target.getVisibleEntities() );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user