fix for resources which have not equal amound and maxAmount

A simple fix for resources.
MaxAmount and Amount can now be correct assigned to the welded part.