Author: sveinung Date: Fri Jul 3 13:33:35 2015 New Revision: 29193 URL: http://svn.gna.org/viewcvs/freeciv?rev=29193&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: trunk/common/actions.c trunk/server/diplomats.c Modified: trunk/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=29193&r1=29192&r2=29193&view=diff ============================================================================== --- trunk/common/actions.c (original) +++ trunk/common/actions.c Fri Jul 3 13:33:35 2015 @@ -1082,8 +1082,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: trunk/server/diplomats.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/diplomats.c?rev=29193&r1=29192&r2=29193&view=diff ============================================================================== --- trunk/server/diplomats.c (original) +++ trunk/server/diplomats.c Fri Jul 3 13:33:35 2015 @@ -1336,8 +1336,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