Complete.Org:
Mailing Lists:
Archives:
freeciv-dev:
July 2006: [Freeciv-Dev] (PR#19032) Patch to fix backwards diplomat_success_vs_defe |
[Freeciv-Dev] (PR#19032) Patch to fix backwards diplomat_success_vs_defe[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=19032 > This transaction appears to have no content Patch to fix diplomat_success_vs_defender() in diplomats.c. According to source code documentation (comments), diplomat_success_vs_defender returns TRUE if the "attacker" succeeds. However, this function was erroneously checking if the *defender* was a SUPER_SPY rather than the attacker. (The calling function, e.g. diplomat_infiltrate_tile(), checks if the defender is SUPER_SPY, so diplomat_success_vs_defender() does not need to.) Also, the 'return myrand(100) > chance;' at the bottom of the function was reversed. It *should* be '<', since the 'chance' is the calculated chance that the attacker succeeds (chance is increased if attacker is veteren, for example). Patch works against revision 12162 or earlier/later. Peter LunicksPatch to fix diplomat_success_vs_defender() in diplomats.c. According to source code documentation (comments), diplomat_success_vs_defender returns TRUE if the "attacker" succeeds. However, this function was erroneously checking if the *defender* was a SUPER_SPY rather than the attacker. (The calling function, e.g. diplomat_infiltrate_tile(), checks if the defender is SUPER_SPY, so diplomat_success_vs_defender() does not need to.) Also, the 'return myrand(100) > chance;' at the bottom of the function was reversed. It *should* be '<', since the 'chance' is the calculated chance that the attacker succeeds (chance is increased if attacker is veteren, for example). Patch works against revision 12162 or earlier/later. Peter Lunicks
diplomat_success_vs_defender-fix.patch
|