diff --git a/client/client_types.cpp b/client/client_types.cpp
index 88cc23b0a3..da85f6b012 100644
--- a/client/client_types.cpp
+++ b/client/client_types.cpp
@@ -443,7 +443,7 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) {
if (no_rsc_pref[j]) {
out.printf(" %s\n", rsc_name(j));
}
- if (j>0 && gui_rpc & ncoprocs_excluded[j] == rsc_work_fetch[j].ninstances) {
+ if (j>0 && gui_rpc && (ncoprocs_excluded[j] == rsc_work_fetch[j].ninstances)) {
out.printf(" %s\n", rsc_name(j));
}
}