Saving Types

BlitzPlus Forums/BlitzPlus Programming/Saving Types

I'm Trying to save types, and when loading, replace the values in each of the types with the ones that had been saved, eg:
;---------
(saving preperation etc)
for d.door=each door
d\open=writeint(save, d\open)
next
(loadingpreperation etc)
for d.door=each door
d\open=readint(load, d\open)
next
;---------
It works. It reads the variable correctly, but when i for example open a locked door, and then load from the last saved file, that door will now be open, not locked.
any ideas on why?
Could it be anything to do with locked doors having 'd\open'=0 (as default)?