Follow-up Comment #9, patch #1501 (project freeciv): > If killunhomed = 100, the result will be hp = 0. I think the correct algorithm you want is: > punit->hp = MAX((punit->hp * (100 - game.server.killunhomed)) / 100, 1);
This way the unit would survive (hit points > 0) > punit->hp -= MAX(punit->hp * game.server.killunhomed / 100, 1); I think this is the way to go. Here the hit point loss is calculated with at least 1 hp loss each turn ... (file #8413) _______________________________________________________ Additional Item Attachment: File name: 20100307-trunk-add-option-to-slowly-kill-unhomed-units-killunhomed.diff Size:7 KB _______________________________________________________ Reply to this item at: <http://gna.org/patch/?1501> _______________________________________________ Nachricht geschickt von/durch Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev