URL: <http://gna.org/bugs/?25432>
Summary: Terrain bonus of last one digit is round downed. (e.g. 25% -> 20%) Project: Freeciv Submitted by: cazfi Submitted on: Thu 12 Jan 2017 10:40:12 PM EET Category: general Severity: 3 - Normal Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Release: 2.5.6 Discussion Lock: Any Operating System: None Planned Release: Contains string changes: None _______________________________________________________ Details: From http://freeciv.wikia.com/wiki/Forum:Some_tiny_issues : According to common\combat.c get_defense_power: if (uclass_has_flag(unit_class(punit), UCF_TERRAIN_DEFENSE)) { db = 10 + tile_terrain(ptile)->defense_bonus / 10; power = (power * db) / 10; } since all variables is int, so terrain bonus of last one digit is round down, so ignored. (e.g. civ2civ3 forest 25% terrain bonus is actually 20%) I tried Freeciv 2.5.6 gtk+2 with -d 3 option and see internal combat attack/defense strength when combat occur, and round downed. (civ2civ3 green phalanx internal defense strength in forest is 24, not 25) Following functions have defense bonus / 10 relations: server\advisors\advgoto.c adv_danger_at server\advisors\advgoto.c chance_killed_at common\combat.c get_defense_power common\combat.c get_virtual_defense_power ai\default\aisettler.c defense_bonus ai\default\aiunit.c dai_consider_tile_dangerous (ai\default\aiparatrooper.c find_best_tile_to_paradrop_to) <- it is AI value weighting for paradropping to target tile, so there is no relation _______________________________________________________ Reply to this item at: <http://gna.org/bugs/?25432> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev