bug report:
If the research cost plus the current resource amount is larger than the resource limit, the resource production would stop during the research.
The research cost should be part of the current resource amount. It should not contubue the contribute to the limit calculation.