fix relationsToArray

The relationsToArray needs to unset it's relation value at the end of
every loop.
Merge pull request #6199 from Flightfreak/4.2

[4.2] Fixed "relationsToArray"