[Freeciv-commits] r34065 - in /branches/S2_6/common: actions.c actions.h
Author: sveinung Date: Sat Oct 8 20:57:50 2016 New Revision: 34065 URL: http://svn.gna.org/viewcvs/freeciv?rev=34065=rev Log: Allow removing an enabler from a ruleset. Rulesets can now change while in memory. Improve action enabler support of this by introducing the function action_enabler_remove(). See patch #7787 Modified: branches/S2_6/common/actions.c branches/S2_6/common/actions.h Modified: branches/S2_6/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=34065=34064=34065=diff == --- branches/S2_6/common/actions.c (original) +++ branches/S2_6/common/actions.c Sat Oct 8 20:57:50 2016 @@ -476,6 +476,18 @@ } /** + Remove an action enabler from the current ruleset. + + Returns TRUE on success. +**/ +bool action_enabler_remove(struct action_enabler *enabler) +{ + return action_enabler_list_remove( +action_enablers_for_action(enabler->action), +enabler); +} + +/** Get all enablers for an action. **/ struct action_enabler_list * Modified: branches/S2_6/common/actions.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.h?rev=34065=34064=34065=diff == --- branches/S2_6/common/actions.h (original) +++ branches/S2_6/common/actions.h Sat Oct 8 20:57:50 2016 @@ -172,6 +172,7 @@ struct action_enabler *action_enabler_new(void); void action_enabler_add(struct action_enabler *enabler); +bool action_enabler_remove(struct action_enabler *enabler); bool is_action_enabled_unit_on_city(const enum gen_action wanted_action, const struct unit *actor_unit, ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34064 - /branches/S2_6/common/actions.c
Author: sveinung Date: Sat Oct 8 20:57:29 2016 New Revision: 34064 URL: http://svn.gna.org/viewcvs/freeciv?rev=34064=rev Log: Clarify action_enabler_add() comment header. See patch #7786 Modified: branches/S2_6/common/actions.c Modified: branches/S2_6/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=34064=34063=34064=diff == --- branches/S2_6/common/actions.c (original) +++ branches/S2_6/common/actions.c Sat Oct 8 20:57:29 2016 @@ -466,7 +466,7 @@ } /** - Add an action enabler. + Add an action enabler to the current ruleset. **/ void action_enabler_add(struct action_enabler *enabler) { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34063 - in /branches/S2_6/common: actions.c actions.h
Author: sveinung Date: Sat Oct 8 20:57:09 2016 New Revision: 34063 URL: http://svn.gna.org/viewcvs/freeciv?rev=34063=rev Log: Initialize the action of new action enablers. Have action_enabler_new() set the action of the newly created enabler to a known invalid value. See bug #25157 Modified: branches/S2_6/common/actions.c branches/S2_6/common/actions.h Modified: branches/S2_6/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=34063=34062=34063=diff == --- branches/S2_6/common/actions.c (original) +++ branches/S2_6/common/actions.c Sat Oct 8 20:57:09 2016 @@ -458,6 +458,10 @@ requirement_vector_init(>actor_reqs); requirement_vector_init(>target_reqs); + /* Make sure that action doesn't end up as a random value that happens to + * be a valid action id. */ + enabler->action = ACTION_NONE; + return enabler; } Modified: branches/S2_6/common/actions.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.h?rev=34063=34062=34063=diff == --- branches/S2_6/common/actions.h (original) +++ branches/S2_6/common/actions.h Sat Oct 8 20:57:09 2016 @@ -74,6 +74,9 @@ /* Used in searches to signal that any action at all is OK. */ #define ACTION_ANY ACTION_COUNT +/* Used to signal the absence of any actions. */ +#define ACTION_NONE ACTION_COUNT + /* Used in the network protocol */ #define SPECENUM_NAME action_proto_signal /* The player wants to be reminded to ask what actions the unit can perform ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34062 - /branches/S2_5/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css
Author: cazfi Date: Sat Oct 8 20:42:31 2016 New Revision: 34062 URL: http://svn.gna.org/viewcvs/freeciv?rev=34062=rev Log: Corrected font definition in gtk3-client Freeciv theme. See bug #25160 Modified: branches/S2_5/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css Modified: branches/S2_5/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css?rev=34062=34061=34062=diff == --- branches/S2_5/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css (original) +++ branches/S2_5/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css Sat Oct 8 20:42:31 2016 @@ -187,7 +187,8 @@ } #Freeciv #city_info_label { - font: Monospace 8; + font-family: Monospace; + font-size: 8px; } #Freeciv #help_label { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34061 - /branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css
Author: cazfi Date: Sat Oct 8 20:42:26 2016 New Revision: 34061 URL: http://svn.gna.org/viewcvs/freeciv?rev=34061=rev Log: Corrected font definition in gtk3-client Freeciv theme. See bug #25160 Modified: branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css Modified: branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css?rev=34061=34060=34061=diff == --- branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css (original) +++ branches/S2_6/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css Sat Oct 8 20:42:26 2016 @@ -187,7 +187,8 @@ } #Freeciv #city_info_label { - font: Monospace 8; + font-family: Monospace; + font-size: 8px; } #Freeciv #help_label { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34060 - in /trunk/data/themes: gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css gui-gtk-3.22/Freeciv/gtk-3.0/gtk.css
Author: cazfi Date: Sat Oct 8 20:42:22 2016 New Revision: 34060 URL: http://svn.gna.org/viewcvs/freeciv?rev=34060=rev Log: Corrected font definition in gtk3-client Freeciv theme. See bug #25160 Modified: trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css trunk/data/themes/gui-gtk-3.22/Freeciv/gtk-3.0/gtk.css Modified: trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css?rev=34060=34059=34060=diff == --- trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css (original) +++ trunk/data/themes/gui-gtk-3.0/Freeciv/gtk-3.0/gtk.css Sat Oct 8 20:42:22 2016 @@ -187,7 +187,8 @@ } #Freeciv #city_info_label { - font: Monospace 8; + font-family: Monospace; + font-size: 8px; } #Freeciv #help_label { Modified: trunk/data/themes/gui-gtk-3.22/Freeciv/gtk-3.0/gtk.css URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-gtk-3.22/Freeciv/gtk-3.0/gtk.css?rev=34060=34059=34060=diff == --- trunk/data/themes/gui-gtk-3.22/Freeciv/gtk-3.0/gtk.css (original) +++ trunk/data/themes/gui-gtk-3.22/Freeciv/gtk-3.0/gtk.css Sat Oct 8 20:42:22 2016 @@ -188,7 +188,8 @@ } #Freeciv #city_info_label { - font: Monospace 8; + font-family: Monospace; + font-size: 8px; } #Freeciv #help_label { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34059 - in /trunk: common/actions.c common/actions.h common/scriptcore/api_game_methods.c server/rssanity.c server/unithand.c
Author: sveinung Date: Sat Oct 8 20:37:53 2016 New Revision: 34059 URL: http://svn.gna.org/viewcvs/freeciv?rev=34059=rev Log: Make names of action rule name getters similar. Rename action_get_rule_name() to action_id_rule_name(). Move the header declaration of action_rule_name() next to it. See patch #7788 Modified: trunk/common/actions.c trunk/common/actions.h trunk/common/scriptcore/api_game_methods.c trunk/server/rssanity.c trunk/server/unithand.c Modified: trunk/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34059=34058=34059=diff == --- trunk/common/actions.c (original) +++ trunk/common/actions.c Sat Oct 8 20:37:53 2016 @@ -534,7 +534,7 @@ const char *action_rule_name(const struct action *action) { /* Rule name is still hard coded. */ - return action_get_rule_name(action->id); + return action_id_rule_name(action->id); } /** @@ -550,7 +550,7 @@ /** Get the rule name of the action. **/ -const char *action_get_rule_name(int action_id) +const char *action_id_rule_name(int action_id) { fc_assert_msg(actions[action_id], "Action %d don't exist.", action_id); @@ -723,7 +723,7 @@ fc_assert_msg(AAK_UNIT == action_id_get_actor_kind(action_id), "Action %s isn't performed by a unit", -action_get_rule_name(action_id)); +action_id_rule_name(action_id)); return action_id + L_LAST; } Modified: trunk/common/actions.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=34059=34058=34059=diff == --- trunk/common/actions.h (original) +++ trunk/common/actions.h Sat Oct 8 20:37:53 2016 @@ -316,7 +316,6 @@ action_get_target_kind(action_by_number(action_id)) int action_number(const struct action *action); -const char *action_rule_name(const struct action *action); const char *action_name_translation(const struct action *action); @@ -344,7 +343,8 @@ int action_get_role(int action_id); -const char *action_get_rule_name(int action_id); +const char *action_rule_name(const struct action *action); +const char *action_id_rule_name(int action_id); const char *action_get_ui_name(int action_id); const char *action_get_ui_name_mnemonic(int action_id, const char* mnemonic); Modified: trunk/common/scriptcore/api_game_methods.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/api_game_methods.c?rev=34059=34058=34059=diff == --- trunk/common/scriptcore/api_game_methods.c (original) +++ trunk/common/scriptcore/api_game_methods.c Sat Oct 8 20:37:53 2016 @@ -643,7 +643,7 @@ LUASCRIPT_CHECK_STATE(L, NULL); LUASCRIPT_CHECK_SELF(L, pact, NULL); - return action_get_rule_name(pact->id); + return action_id_rule_name(pact->id); } /* Modified: trunk/server/rssanity.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/rssanity.c?rev=34059=34058=34059=diff == --- trunk/server/rssanity.c (original) +++ trunk/server/rssanity.c Sat Oct 8 20:37:53 2016 @@ -921,14 +921,14 @@ if (paction->min_distance < 0) { ruleset_error(LOG_ERROR, "Action %s: negative min distance (%d).", -action_get_rule_name(act), paction->min_distance); +action_id_rule_name(act), paction->min_distance); ok = FALSE; } if (paction->min_distance > ACTION_DISTANCE_LAST_NON_SIGNAL) { ruleset_error(LOG_ERROR, "Action %s: min distance (%d) larger than " "any distance on a map can be (%d).", -action_get_rule_name(act), paction->min_distance, +action_id_rule_name(act), paction->min_distance, ACTION_DISTANCE_LAST_NON_SIGNAL); ok = FALSE; } @@ -936,14 +936,14 @@ if (paction->max_distance > ACTION_DISTANCE_MAX) { ruleset_error(LOG_ERROR, "Action %s: max distance is %d. " "A map can't be that big.", -action_get_rule_name(act), paction->max_distance); +action_id_rule_name(act), paction->max_distance); ok = FALSE; } if (!action_distance_inside_max(paction, paction->min_distance)) { ruleset_error(LOG_ERROR, "Action %s: min distance is %d but max distance is %d.", -action_get_rule_name(act), +
[Freeciv-commits] r34056 - /trunk/tools/ruledit/tab_enablers.cpp
Author: sveinung Date: Sat Oct 8 20:37:07 2016 New Revision: 34056 URL: http://svn.gna.org/viewcvs/freeciv?rev=34056=rev Log: ruledit: don't add action enabler manually. Use action_enabler_add() to add a recently created action enabler. See patch #7783 Modified: trunk/tools/ruledit/tab_enablers.cpp Modified: trunk/tools/ruledit/tab_enablers.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruledit/tab_enablers.cpp?rev=34056=34055=34056=diff == --- trunk/tools/ruledit/tab_enablers.cpp(original) +++ trunk/tools/ruledit/tab_enablers.cppSat Oct 8 20:37:07 2016 @@ -196,8 +196,7 @@ new_enabler->action = ACTION_MARKETPLACE; - action_enabler_list_append(action_enablers_for_action(ACTION_MARKETPLACE), - new_enabler); + action_enabler_add(new_enabler); } /** ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34057 - /trunk/common/actions.c
Author: sveinung Date: Sat Oct 8 20:37:23 2016 New Revision: 34057 URL: http://svn.gna.org/viewcvs/freeciv?rev=34057=rev Log: Clarify action_enabler_add() comment header. See patch #7786 Modified: trunk/common/actions.c Modified: trunk/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34057=34056=34057=diff == --- trunk/common/actions.c (original) +++ trunk/common/actions.c Sat Oct 8 20:37:23 2016 @@ -764,7 +764,7 @@ } /** - Add an action enabler. + Add an action enabler to the current ruleset. **/ void action_enabler_add(struct action_enabler *enabler) { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34054 - /branches/S2_6/client/gui-gtk-3.22/
Author: cazfi Date: Sat Oct 8 17:51:22 2016 New Revision: 34054 URL: http://svn.gna.org/viewcvs/freeciv?rev=34054=rev Log: Added and properly use GUI_GTK_OPTION() macro in gtk3.22-client. See patch #7767 Modified: branches/S2_6/client/gui-gtk-3.22/chatline.c branches/S2_6/client/gui-gtk-3.22/citydlg.c branches/S2_6/client/gui-gtk-3.22/dialogs.c branches/S2_6/client/gui-gtk-3.22/gui_main.c branches/S2_6/client/gui-gtk-3.22/gui_main.h branches/S2_6/client/gui-gtk-3.22/gui_stuff.c branches/S2_6/client/gui-gtk-3.22/gui_stuff.h branches/S2_6/client/gui-gtk-3.22/luaconsole.c branches/S2_6/client/gui-gtk-3.22/mapctrl.c branches/S2_6/client/gui-gtk-3.22/mapview.c branches/S2_6/client/gui-gtk-3.22/menu.c branches/S2_6/client/gui-gtk-3.22/messagewin.c branches/S2_6/client/gui-gtk-3.22/pages.c branches/S2_6/client/gui-gtk-3.22/theme_dlg.c branches/S2_6/client/gui-gtk-3.22/themes.c branches/S2_6/client/gui-gtk-3.22/wldlg.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/S2_6/client/gui-gtk-3.22/chatline.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/chatline.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/citydlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/citydlg.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/dialogs.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/dialogs.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/gui_main.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/gui_main.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/gui_main.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/gui_main.h?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/gui_stuff.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/gui_stuff.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/gui_stuff.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/gui_stuff.h?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/luaconsole.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/luaconsole.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/mapctrl.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/mapctrl.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/mapview.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/mapview.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/menu.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/menu.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/messagewin.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/messagewin.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/pages.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/pages.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/theme_dlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/theme_dlg.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/themes.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/themes.c?rev=34054=34053=34054=diff Modified: branches/S2_6/client/gui-gtk-3.22/wldlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/wldlg.c?rev=34054=34053=34054=diff ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34052 - /branches/S2_6/ai/default/aisettler.c
Author: cazfi Date: Sat Oct 8 14:58:34 2016 New Revision: 34052 URL: http://svn.gna.org/viewcvs/freeciv?rev=34052=rev Log: Fixed compiler shadow warning from aisettler.c See bug #25159 Modified: branches/S2_6/ai/default/aisettler.c Modified: branches/S2_6/ai/default/aisettler.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/default/aisettler.c?rev=34052=34051=34052=diff == --- branches/S2_6/ai/default/aisettler.c(original) +++ branches/S2_6/ai/default/aisettler.cSat Oct 8 14:58:34 2016 @@ -1186,8 +1186,8 @@ **/ void dai_auto_settler_reset(struct ai_type *ait, struct player *pplayer) { - bool close; - struct ai_plr *ai = dai_plr_data_get(ait, pplayer, ); + bool caller_closes; + struct ai_plr *ai = dai_plr_data_get(ait, pplayer, _closes); fc_assert_ret(ai != NULL); fc_assert_ret(ai->settler != NULL); @@ -1207,7 +1207,7 @@ tile_data_cache_hash_clear(ai->settler->tdc_hash); - if (close) { + if (caller_closes) { dai_data_phase_finished(ait, pplayer); } } ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits