Author: sveinung Date: Mon Jul 4 16:45:21 2016 New Revision: 33162 URL: http://svn.gna.org/viewcvs/freeciv?rev=33162&view=rev Log: sdl clients: explicit action probability type.
See patch #7364 Modified: branches/S2_6/client/gui-sdl/action_dialog.c branches/S2_6/client/gui-sdl2/action_dialog.c Modified: branches/S2_6/client/gui-sdl/action_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/action_dialog.c?rev=33162&r1=33161&r2=33162&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl/action_dialog.c (original) +++ branches/S2_6/client/gui-sdl/action_dialog.c Mon Jul 4 16:45:21 2016 @@ -807,7 +807,7 @@ Add an entry for an action in the action choice dialog. **************************************************************************/ static void action_entry(const enum gen_action act, - const int *action_probabilities, + const action_probability *act_probs, const char *custom, struct unit *act_unit, struct city *tgt_city, @@ -821,7 +821,7 @@ if (act == ACTION_SPY_SABOTAGE_CITY && action_prob_possible( - action_probabilities[ACTION_SPY_TARGETED_SABOTAGE_CITY])) { + act_probs[ACTION_SPY_TARGETED_SABOTAGE_CITY])) { /* The player can select Sabotage City from the target selection dialog * of Targeted Sabotage City. */ return; @@ -829,19 +829,19 @@ if (act == ACTION_SPY_STEAL_TECH && action_prob_possible( - action_probabilities[ACTION_SPY_TARGETED_STEAL_TECH])) { + act_probs[ACTION_SPY_TARGETED_STEAL_TECH])) { /* The player can select Steal Tech from the target selection dialog of * Targeted Steal Tech. */ return; } /* Don't show disabled actions */ - if (!action_prob_possible(action_probabilities[act])) { + if (!action_prob_possible(act_probs[act])) { return; } ui_name = action_prepare_ui_name(act, "", - action_probabilities[act], custom); + act_probs[act], custom); create_active_iconlabel(pBuf, pWindow->dst, pStr, ui_name, af_map[act]); Modified: branches/S2_6/client/gui-sdl2/action_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/action_dialog.c?rev=33162&r1=33161&r2=33162&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl2/action_dialog.c (original) +++ branches/S2_6/client/gui-sdl2/action_dialog.c Mon Jul 4 16:45:21 2016 @@ -810,7 +810,7 @@ Add an entry for an action in the action choice dialog. **************************************************************************/ static void action_entry(const enum gen_action act, - const int *action_probabilities, + const action_probability *act_probs, const char *custom, struct unit *act_unit, struct city *tgt_city, @@ -824,7 +824,7 @@ if (act == ACTION_SPY_SABOTAGE_CITY && action_prob_possible( - action_probabilities[ACTION_SPY_TARGETED_SABOTAGE_CITY])) { + act_probs[ACTION_SPY_TARGETED_SABOTAGE_CITY])) { /* The player can select Sabotage City from the target selection dialog * of Targeted Sabotage City. */ return; @@ -832,19 +832,19 @@ if (act == ACTION_SPY_STEAL_TECH && action_prob_possible( - action_probabilities[ACTION_SPY_TARGETED_STEAL_TECH])) { + act_probs[ACTION_SPY_TARGETED_STEAL_TECH])) { /* The player can select Steal Tech from the target selection dialog of * Targeted Steal Tech. */ return; } /* Don't show disabled actions */ - if (!action_prob_possible(action_probabilities[act])) { + if (!action_prob_possible(act_probs[act])) { return; } ui_name = action_prepare_ui_name(act, "", - action_probabilities[act], custom); + act_probs[act], custom); create_active_iconlabel(pBuf, pWindow->dst, pstr, ui_name, af_map[act]); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits