2 changes: 2 additions & 0 deletions src/feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ int32_t featureDamage(FEATURE *psFeature, UDWORD damage, WEAPON_CLASS weaponClas

extern void featureInitVars(void);

Vector2i getFeatureStatsSize(FEATURE_STATS const *pStructureType);

#define syncDebugFeature(psFeature, ch) _syncDebugFeature(__FUNCTION__, psFeature, ch)
void _syncDebugFeature(const char *function, FEATURE const *psFeature, char ch);

Expand Down
4 changes: 2 additions & 2 deletions src/intdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2712,13 +2712,13 @@ DROID_TEMPLATE *FactoryGetTemplate(FACTORY *Factory)
return (DROID_TEMPLATE *)Factory->psSubject;
}

bool StatIsStructure(BASE_STATS *Stat)
bool StatIsStructure(BASE_STATS const *Stat)
{
return (Stat->ref >= REF_STRUCTURE_START && Stat->ref <
REF_STRUCTURE_START + REF_RANGE);
}

bool StatIsFeature(BASE_STATS *Stat)
bool StatIsFeature(BASE_STATS const *Stat)
{
return (Stat->ref >= REF_FEATURE_START && Stat->ref <
REF_FEATURE_START + REF_RANGE);
Expand Down
4 changes: 2 additions & 2 deletions src/intdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ FACTORY *StructureGetFactory(STRUCTURE *Structure);

//SDWORD ResearchGetImage(RESEARCH_FACILITY *Research);

bool StatIsStructure(BASE_STATS *Stat);
bool StatIsStructure(BASE_STATS const *Stat);
iIMDShape *StatGetStructureIMD(BASE_STATS *Stat,UDWORD Player);
bool StatIsTemplate(BASE_STATS *Stat);
bool StatIsFeature(BASE_STATS *Stat);
bool StatIsFeature(BASE_STATS const *Stat);

SDWORD StatIsComponent(BASE_STATS *Stat);
bool StatGetComponentIMD(BASE_STATS *Stat, SDWORD compID,iIMDShape **CompIMD,iIMDShape **MountIMD);
Expand Down
3 changes: 1 addition & 2 deletions src/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,7 @@ void orderUpdateDroid(DROID *psDroid)
psDroid->order = DORDER_NONE;
actionDroid(psDroid, DACTION_NONE);
}
else if (actionReachedBuildPos(psDroid, psDroid->psTarget->pos.x, psDroid->psTarget->pos.y,
((STRUCTURE *)psDroid->psTarget)->pStructureType))
else if (actionReachedBuildPos(psDroid, psDroid->psTarget->pos.x, psDroid->psTarget->pos.y, ((STRUCTURE *)psDroid->psTarget)->rot.direction, ((STRUCTURE *)psDroid->psTarget)->pStructureType))
{
recycleDroid(psDroid);
}
Expand Down
32 changes: 0 additions & 32 deletions src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4154,38 +4154,6 @@ bool validLocation(BASE_STATS *psStats, unsigned x, unsigned y, uint16_t directi
}
}

// special droid/max-min test for repair facility
if ( valid && (psBuilding->type == REF_REPAIR_FACILITY))
{
getTileMaxMin(x, y, &max, &min);
if ((max - min) > MAX_INCLINE)
{
valid = false;
}
if (valid &&
!noDroid(x,y))
{
valid = false;
}
}

if (valid && // only do if necessary
(psBuilding->type != REF_REPAIR_FACILITY))
{
for (i = site.xTL; i <= site.xBR && valid; i++)
{
for (j = site.yTL; j <= site.yBR && valid; j++)
{
// This really needs to check to see if the droid that's in the way is the droid that wants to build
// in which case it should'nt invalidate the location.
if(noDroid(i,j) == false)
{
valid = false;
}
}
}
}

//walls/defensive structures can be built along any ground
if (valid && // only do if necessary
(!(psBuilding->type == REF_REPAIR_FACILITY ||
Expand Down