Sectors and ships no longer need shells to fire flak
4.0.9 changed flak not to use up shells, but they still had to be present. Drop that, because it doesn't really provide any value. Moreover, this gets rid of the buggy flak shell supply code (seqno mismatch oopses, lost supplies).
This commit is contained in:
parent
7cce3124bf
commit
c0b300d875
4 changed files with 5 additions and 48 deletions
|
@ -637,7 +637,6 @@ ac_planedamage(struct plist *plp, natid from, int dam, natid other,
|
|||
static void
|
||||
ac_doflak(struct emp_qelem *list, struct sctstr *from)
|
||||
{
|
||||
int shell;
|
||||
int gun;
|
||||
natid plane_owner;
|
||||
struct plist *plp;
|
||||
|
@ -646,16 +645,6 @@ ac_doflak(struct emp_qelem *list, struct sctstr *from)
|
|||
plane_owner = plp->plane.pln_own;
|
||||
|
||||
gun = MIN(FLAK_GUN_MAX, from->sct_item[I_GUN]);
|
||||
shell = from->sct_item[I_SHELL];
|
||||
if (gun > shell * 2) {
|
||||
shell += supply_commod(from->sct_own, from->sct_x, from->sct_y,
|
||||
I_SHELL, (gun + 1) / 2 - shell);
|
||||
from->sct_item[I_SHELL] = shell;
|
||||
putsect(from);
|
||||
}
|
||||
if (gun > shell * 2)
|
||||
gun = shell * 2;
|
||||
|
||||
gun = roundavg(tfact(from->sct_own, 2.0 * gun));
|
||||
if (gun > 0) {
|
||||
PR(plane_owner, "firing %d flak guns in %s...\n",
|
||||
|
@ -674,7 +663,7 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y)
|
|||
struct shpstr ship;
|
||||
struct mchrstr *mcp;
|
||||
double flak, total, ngun;
|
||||
int gun, shell;
|
||||
int gun;
|
||||
int rel;
|
||||
struct plist *plp;
|
||||
natid plane_owner;
|
||||
|
@ -694,18 +683,8 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y)
|
|||
rel = getrel(getnatp(ship.shp_own), plane_owner);
|
||||
if (rel > HOSTILE)
|
||||
continue;
|
||||
shell = 0;
|
||||
gun = shp_usable_guns(&ship);
|
||||
if (gun) {
|
||||
shell = ship.shp_item[I_SHELL];
|
||||
if (shell <= 0) {
|
||||
shell = supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
|
||||
I_SHELL, 1);
|
||||
ship.shp_item[I_SHELL] = shell;
|
||||
putship(ship.shp_uid, &ship);
|
||||
}
|
||||
}
|
||||
if (gun == 0 || shell == 0)
|
||||
if (gun == 0)
|
||||
continue;
|
||||
flak = gun * (ship.shp_effic / 100.0);
|
||||
ngun += flak;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue