]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/conv.c
commands: Rename the command functions
[empserver] / src / lib / commands / conv.c
index 76a1523a72872d5476e742f1f5eba3b9a8010202..70977511ab3a0cc1739e19785c44d93b12199cef 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
 
 #include "chance.h"
 #include "commands.h"
-#include "land.h"
 
 int
-conv(void)
+c_convert(void)
 {
     struct natstr *natp;
     struct sctstr sect;
     struct nstr_sect nstr;
     int uwtoconvert, newuw, totaluw, uw;
-    int maxpop, civ, mil, nsec, adj_mob, mob;
+    int maxpop, civ, seceff, adj_mob, mob;
+    double secstr;
     double security_extra = 1.0;
 
     if (!snxtsct(&nstr, player->argp[1]))
@@ -66,11 +66,11 @@ conv(void)
        natp = getnatp(sect.sct_own);
        maxpop = max_pop(natp->nat_level[NAT_RLEV], &sect);
        civ = sect.sct_item[I_CIVIL];
-       mil = security_strength(&sect, &nsec);
+       secstr = security_strength(&sect, &seceff);
        /*
         * Must have military control to convert captured civs.
         */
-       if (mil * 10 < civ)
+       if (secstr * 10 < civ)
            continue;
        newuw = civ;
        if (newuw > uwtoconvert)
@@ -88,7 +88,7 @@ conv(void)
        mob = sect.sct_mobil * 5;
 
        /* security troops make conversion more effective */
-       security_extra = 1.0 + nsec / 10.0;
+       security_extra = 1.0 + seceff / 1000.0;
        adj_mob = ldround(((double)mob * security_extra), 1);
 
        if (adj_mob < newuw)