main.js

The buy function needs fixing - it incorrectly identifies whether a sufficient amount of resources exist.