Author: cazfi Date: Thu Sep 29 06:04:41 2016 New Revision: 33941 URL: http://svn.gna.org/viewcvs/freeciv?rev=33941&view=rev Log: Save goods flags to ruleset.
See bug #25124 Modified: trunk/tools/ruleutil/rulesave.c Modified: trunk/tools/ruleutil/rulesave.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleutil/rulesave.c?rev=33941&r1=33940&r2=33941&view=diff ============================================================================== --- trunk/tools/ruleutil/rulesave.c (original) +++ trunk/tools/ruleutil/rulesave.c Thu Sep 29 06:04:41 2016 @@ -1239,6 +1239,8 @@ sect_idx = 0; goods_active_type_iterate(pgood) { char path[512]; + const char *flag_names[GF_COUNT]; + int flagi; fc_snprintf(path, sizeof(path), "goods_%d", sect_idx++); @@ -1249,6 +1251,17 @@ save_default_int(sfile, pgood->from_pct, 100, path, "from_pct"); save_default_int(sfile, pgood->to_pct, 100, path, "to_pct"); + set_count = 0; + for (flagi = 0; flagi < GF_COUNT; flagi++) { + if (goods_has_flag(pgood, flagi)) { + flag_names[set_count++] = goods_flag_id_name(flagi); + } + } + + if (set_count > 0) { + secfile_insert_str_vec(sfile, flag_names, set_count, + "%s.flags", path); + } } goods_active_type_iterate_end; locks = FALSE; _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits