{
GET(CellClass *, pCell, EDI);
GET(HouseClass *, OverlayOwner, ESI);
GET(int, idxOverlay, ECX);
GET_STACK(BuildingTypeClass *, PlacingObject, 0x20);
GET_STACK(HouseClass *, PlacingOwner, 0x24);
enum { Adequate = 0x47CA70, Inadequate = 0x47C94F } Status = Inadequate;
if(PlacingObject) {
bool ContainsWall = idxOverlay != -1 && OverlayTypeClass::Array->GetItem(idxOverlay)->Wall;
if(ContainsWall && PlacingObject->Gate) {
Status = Adequate;
}
if(OverlayTypeClass * ToOverlay = PlacingObject->ToOverlay) {
if(ToOverlay->ArrayIndex == idxOverlay) {
if(pCell->Powerup >= 0x10) {
Status = Adequate;
}
}
}
}
if(Status == Inadequate) {
switch(idxOverlay) {
case OVERLAY_GASAND:
case OVERLAY_GAWALL:
if (PlacingObject == RulesClass::Instance->WallTower ||
PlacingObject == RulesClass::Instance->GDIGateOne ||
PlacingObject == RulesClass::Instance->GDIGateTwo) {
Status = Adequate;
}
break;
case OVERLAY_NAWALL:
if(PlacingObject == RulesClass::Instance->NodGateOne ||
PlacingObject == RulesClass::Instance->NodGateTwo) {
Status = Adequate;
}
break;
}
}
if(Status == Adequate) {
if(PlacingOwner != OverlayOwner) {
Status = Inadequate;
}
}
return Status;
}