Fix serialising stock counts being wrong due to references.
Fix serialising stock counts being wrong due to references.

smrealms/smrv2.0,tmaus/smr,smrealms/smr,smrealms/smr,hemberger/smr,gamedevforks/smr,tmaus/smr,hemberger/smr,smrealms/smrv2.0,gamedevforks/smr,Curufir/smr,hemberger/smr,hemberger/smr,gamedevforks/smr,smrealms/smrv2.0,smrealms/smr,smrealms/smrv2.0,gamedevforks/smr,Curufir/smr,Curufir/smr