(multifire): If firing at a submarine with something that can't drop
depth charges, don't disclose the target is a submarine. Old code allowed players to find all submarine uids.
This commit is contained in:
parent
c5ec381b4f
commit
aa26c53e47
1 changed files with 9 additions and 12 deletions
|
@ -350,11 +350,9 @@ multifire(void)
|
||||||
pr("range is %.2f (%.2f)\n", range2, range);
|
pr("range is %.2f (%.2f)\n", range2, range);
|
||||||
if (target == targ_sub) {
|
if (target == targ_sub) {
|
||||||
if ((mchr[(int)fship.shp_type].m_flags & M_DCH) == 0) {
|
if ((mchr[(int)fship.shp_type].m_flags & M_DCH) == 0) {
|
||||||
pr("A %s can't drop depth charges!\n",
|
/* Don't tell it's a sub */
|
||||||
mchr[(int)fship.shp_type].m_name);
|
range2 = -1;
|
||||||
continue;
|
} else if (shell < 2) {
|
||||||
}
|
|
||||||
if (shell < 2) {
|
|
||||||
pr("Not enough shells for depth charge!\n");
|
pr("Not enough shells for depth charge!\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -403,9 +401,8 @@ multifire(void)
|
||||||
range2 = (double)roundrange(range);
|
range2 = (double)roundrange(range);
|
||||||
pr("range is %.2f (%.2f)\n", range2, range);
|
pr("range is %.2f (%.2f)\n", range2, range);
|
||||||
if (target == targ_sub) {
|
if (target == targ_sub) {
|
||||||
pr("A %s can't drop depth charges!\n",
|
/* Don't tell it's a sub */
|
||||||
lchr[(int)fland.lnd_type].l_name);
|
range2 = -1;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gun = fland.lnd_item[I_GUN];
|
gun = fland.lnd_item[I_GUN];
|
||||||
|
@ -456,10 +453,6 @@ multifire(void)
|
||||||
pr("Not enough military for firing crew.\n");
|
pr("Not enough military for firing crew.\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (target == targ_sub) {
|
|
||||||
pr("Target ship not sighted!\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (gun > 7)
|
if (gun > 7)
|
||||||
gun = 7;
|
gun = 7;
|
||||||
range = tfactfire(player->cnum, 7.0);
|
range = tfactfire(player->cnum, 7.0);
|
||||||
|
@ -467,6 +460,10 @@ multifire(void)
|
||||||
range++;
|
range++;
|
||||||
range2 = (double)roundrange(range);
|
range2 = (double)roundrange(range);
|
||||||
pr("range is %.2f (%.2f)\n", range2, range);
|
pr("range is %.2f (%.2f)\n", range2, range);
|
||||||
|
if (target == targ_sub) {
|
||||||
|
/* Don't tell it's a sub */
|
||||||
|
range2 = -1;
|
||||||
|
}
|
||||||
guneff = landgun((int)fsect.sct_effic, gun);
|
guneff = landgun((int)fsect.sct_effic, gun);
|
||||||
dam = (int)guneff;
|
dam = (int)guneff;
|
||||||
shell--;
|
shell--;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue