Author: sveinung Date: Fri Jul 3 13:37:13 2015 New Revision: 29194 URL: http://svn.gna.org/viewcvs/freeciv?rev=29194&view=rev Log: Let SuperSpy units fight back against spy actions.
Let SuperSpy units like Leader defend them self when they are the intended victim of a spy action. SuperSpy units weren't considered when unit victims stopped defending them self. See bug #23672 Modified: branches/S2_6/common/actions.c branches/S2_6/server/diplomats.c Modified: branches/S2_6/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=29194&r1=29193&r2=29194&view=diff ============================================================================== --- branches/S2_6/common/actions.c (original) +++ branches/S2_6/common/actions.c Fri Jul 3 13:37:13 2015 @@ -908,8 +908,12 @@ continue; } - if (punit == pvictim) { - /* A victim unit is defenseless. */ + if (punit == pvictim + && !unit_has_type_flag(punit, UTYF_SUPERSPY)) { + /* The victim unit is defenseless unless it's a SuperSpy. + * Rationalization: A regular diplomat don't mind being bribed. A + * SuperSpy is high enough up the chain that accepting a bribe is + * against his own interests. */ continue; } Modified: branches/S2_6/server/diplomats.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/diplomats.c?rev=29194&r1=29193&r2=29194&view=diff ============================================================================== --- branches/S2_6/server/diplomats.c (original) +++ branches/S2_6/server/diplomats.c Fri Jul 3 13:37:13 2015 @@ -1305,8 +1305,12 @@ continue; } - /* This victim is, by ability or by will, defenseless. */ - if (punit == pvictim) { + if (punit == pvictim + && !unit_has_type_flag(punit, UTYF_SUPERSPY)) { + /* The victim unit is defenseless unless it's a SuperSpy. + * Rationalization: A regular diplomat don't mind being bribed. A + * SuperSpy is high enough up the chain that accepting a bribe is + * against his own interests. */ continue; } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits