Author: sveinung Date: Tue Mar 3 21:57:35 2015 New Revision: 28399 URL: http://svn.gna.org/viewcvs/freeciv?rev=28399&view=rev Log: Add an event type for reporting that a unit's order was against the rules.
Enabler controlled actions are no longer limited to spy actions. It is therefore no longer appropriate to use E_MY_DIPLOMAT_FAILED when a unit was ordered to do an action that turned out to be against the rules. Introduce the new event type E_UNIT_ILLEGAL_ACTION and use it in stead. See patch #5870 Modified: branches/S2_6/common/events.c branches/S2_6/common/events.h branches/S2_6/data/misc/events.spec branches/S2_6/data/stdsounds.soundspec branches/S2_6/fc_version branches/S2_6/server/unithand.c Modified: branches/S2_6/common/events.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/events.c?rev=28399&r1=28398&r2=28399&view=diff ============================================================================== --- branches/S2_6/common/events.c (original) +++ branches/S2_6/common/events.c Tue Mar 3 21:57:35 2015 @@ -204,6 +204,7 @@ GEN_EV(E_SCRIPT, E_S_XYZZY, N_("Scenario/ruleset script message")), /* TRANS: Event name for when the game year changes. */ GEN_EV(E_NEXT_YEAR, E_S_XYZZY, N_("Year Advance")), + GEN_EV(E_UNIT_ILLEGAL_ACTION, E_S_UNIT, N_("Unit Illegal Action")) /* The sound system also generates "e_game_quit", although there's no * corresponding identifier E_GAME_QUIT. */ }; @@ -293,6 +294,7 @@ case E_UNIT_WIN_ATT: case E_UPRISING: case E_UNIT_RELOCATED: + case E_UNIT_ILLEGAL_ACTION: return FALSE; default: Modified: branches/S2_6/common/events.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/events.h?rev=28399&r1=28398&r2=28399&view=diff ============================================================================== --- branches/S2_6/common/events.h (original) +++ branches/S2_6/common/events.h Tue Mar 3 21:57:35 2015 @@ -151,6 +151,8 @@ #define SPECENUM_VALUE113 E_TECH_EMBASSY #define SPECENUM_VALUE114 E_MY_SPY_STEAL_GOLD #define SPECENUM_VALUE115 E_ENEMY_SPY_STEAL_GOLD +#define SPECENUM_VALUE116 E_UNIT_ILLEGAL_ACTION + /* * Note: If you add a new event, make sure you make a similar change * to the events array in "common/events.c" using GEN_EV, to Modified: branches/S2_6/data/misc/events.spec URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/misc/events.spec?rev=28399&r1=28398&r2=28399&view=diff ============================================================================== --- branches/S2_6/data/misc/events.spec (original) +++ branches/S2_6/data/misc/events.spec Tue Mar 3 21:57:35 2015 @@ -88,6 +88,7 @@ 3, 10, "e_enemy_spy_steal_gold" ; 3, 16, "e_enemy_diplomatic_incident" ; 3, 17, "e_enemy_diplomat_escape" ; base sprite for enemy diplomats + 1, 4, "e_unit_illegal_action" 4, 0, "e_achievement" 4, 1, "e_uprising" Modified: branches/S2_6/data/stdsounds.soundspec URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/stdsounds.soundspec?rev=28399&r1=28398&r2=28399&view=diff ============================================================================== --- branches/S2_6/data/stdsounds.soundspec (original) +++ branches/S2_6/data/stdsounds.soundspec Tue Mar 3 21:57:35 2015 @@ -315,6 +315,7 @@ ;e_wonder_stopped = "" ;e_wonder_will_be_built = "" ;e_worklist = "" +;e_unit_illegal_action = "" ; This pseudo-event is only used in the sound system. ;e_game_quit = "" Modified: branches/S2_6/fc_version URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/fc_version?rev=28399&r1=28398&r2=28399&view=diff ============================================================================== --- branches/S2_6/fc_version (original) +++ branches/S2_6/fc_version Tue Mar 3 21:57:35 2015 @@ -54,7 +54,7 @@ # - Avoid adding a new mandatory capability to the development branch for # as long as possible. We want to maintain network compatibility with # the stable branch for as long as possible. -NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-2.6-2015.Feb.22" +NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-2.6-2015.Mar.03" NETWORK_CAPSTRING_OPTIONAL="" FREECIV_DISTRIBUTOR="" Modified: branches/S2_6/server/unithand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unithand.c?rev=28399&r1=28398&r2=28399&view=diff ============================================================================== --- branches/S2_6/server/unithand.c (original) +++ branches/S2_6/server/unithand.c Tue Mar 3 21:57:35 2015 @@ -653,9 +653,6 @@ Tell the client that the action it requested is illegal. This can be caused by the player (and therefore the client) not knowing that some condition of an action no longer is true. - - Remember to stop using E_MY_DIPLOMAT_FAILED if non diplomat actions start - using it. **************************************************************************/ static void illegal_action(struct player *pplayer, struct unit *actor, @@ -678,7 +675,7 @@ send_unit_info(NULL, actor); notify_player(pplayer, unit_tile(actor), - E_MY_DIPLOMAT_FAILED, ftc_server, + E_UNIT_ILLEGAL_ACTION, ftc_server, _("Your %s was unable to %s."), unit_name_translation(actor), gen_action_translated_name(stopped_action)); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits