Scale-free foraging patterns are widespread among animals. These may be the outcome of an optimal searching strategy to find scarce, randomly distributed resources, but a less explored alternative is that this behaviour may result from the interaction of foraging animals with a particular distribution of resources. We introduce a simple foraging model where individual primates follow mental maps and choose their displacements according to a maximum efficiency criterion, in a spatially disordered environment containing many trees with a heterogeneous size distribution. We show that a particular tree-size frequency distribution induces non-Gaussian movement patterns with multiple spatial scales (Lévy walks). These results are consistent with field observations of tree-size variation and spider monkey (Ateles geoffroyi) foraging patterns. We discuss the consequences that our results may have for the patterns of seed dispersal by foraging primates.