]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/lndsub.c
Update copyright notice
[empserver] / src / lib / subs / lndsub.c
index a4bc04ac2482db77a1a938d1b6a2d23b630aa443..077ea84322ca70204afe40d7c536d54587fc122a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -36,6 +36,7 @@
 
 #include <math.h>
 #include <stdlib.h>
+#include "chance.h"
 #include "combat.h"
 #include "damage.h"
 #include "empobj.h"
@@ -211,7 +212,7 @@ lnd_take_casualty(int combat_mode, struct ulist *llp, int cas)
     /* Have to make a retreat check */
 
     ret_chance = llp->unit.land.lnd_retreat - llp->unit.land.lnd_effic;
-    if (roll(100) <= ret_chance) {
+    if (pct_chance(ret_chance)) {
        pr("\n");
        lnd_print(llp->unit.land.lnd_own, llp, "fails morale check!");
        llp->unit.land.lnd_mission = 0;
@@ -1098,7 +1099,7 @@ lnd_support(natid victim, natid attacker, coord x, coord y, int defending)
            nreport(land.lnd_own, N_FIRE_BACK, victim, 1);
        else
            nreport(land.lnd_own, N_FIRE_L_ATTACK, victim, 1);
-       if (roll(100) < lnd_acc(&land))
+       if (pct_chance(lnd_acc(&land) - 1))
            dam2 /= 2;
        dam += dam2;
        if (land.lnd_own != attacker)