Don't spawn resources at maximum density.

Fixes #4278.