Don't truncate research before multiplying with drnuke_const
For drnuke_const 0.33, research level 92.4 now suffices for a tech 280 nuke. Before, you needed 93, which was inconsistent with what version's promise "need 0.33 times the tech level in research".
This commit is contained in:
parent
316436bcfa
commit
8f6c4f18d7
1 changed files with 5 additions and 6 deletions
|
@ -72,7 +72,6 @@ buil(void)
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
int rqtech;
|
int rqtech;
|
||||||
int tlev;
|
int tlev;
|
||||||
int rlev;
|
|
||||||
int type;
|
int type;
|
||||||
char what;
|
char what;
|
||||||
struct lchrstr *lp;
|
struct lchrstr *lp;
|
||||||
|
@ -86,6 +85,8 @@ buil(void)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
natp = getnatp(player->cnum);
|
natp = getnatp(player->cnum);
|
||||||
|
tlev = (int)natp->nat_level[NAT_TLEV];
|
||||||
|
|
||||||
p = getstarg(player->argp[1],
|
p = getstarg(player->argp[1],
|
||||||
"Build (ship, nuke, bridge, plane, land unit, tower)? ",
|
"Build (ship, nuke, bridge, plane, land unit, tower)? ",
|
||||||
buf);
|
buf);
|
||||||
|
@ -105,6 +106,9 @@ buil(void)
|
||||||
pr("There are no nukes in this game.\n");
|
pr("There are no nukes in this game.\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
|
if (drnuke_const > MIN_DRNUKE_CONST)
|
||||||
|
tlev = MIN(tlev,
|
||||||
|
(int)(natp->nat_level[NAT_RLEV] / drnuke_const));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr("You can't build that!\n");
|
pr("You can't build that!\n");
|
||||||
|
@ -113,8 +117,6 @@ buil(void)
|
||||||
|
|
||||||
if (!snxtsct(&nstr, player->argp[2]))
|
if (!snxtsct(&nstr, player->argp[2]))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
tlev = (int)natp->nat_level[NAT_TLEV];
|
|
||||||
rlev = (int)natp->nat_level[NAT_RLEV];
|
|
||||||
|
|
||||||
switch (what) {
|
switch (what) {
|
||||||
case 'p':
|
case 'p':
|
||||||
|
@ -183,9 +185,6 @@ buil(void)
|
||||||
if (type >= 0) {
|
if (type >= 0) {
|
||||||
np = &nchr[type];
|
np = &nchr[type];
|
||||||
rqtech = np->n_tech;
|
rqtech = np->n_tech;
|
||||||
if (drnuke_const > MIN_DRNUKE_CONST)
|
|
||||||
tlev = (tlev < (rlev / drnuke_const) ? (int)tlev :
|
|
||||||
(int)(rlev / drnuke_const));
|
|
||||||
if (rqtech > tlev)
|
if (rqtech > tlev)
|
||||||
type = -1;
|
type = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue