Expanded scope of new_mask_len

When converting the savegames an error raises:
Error: cannot convert new_mask_len or %new_mask_len% to an integer.

This indicates that the variable new_mask_len it's used out of his
scope, we fix it by declaring it at the correct scope.