(add, plane_bomb, pinflak_planedamage, doship, dounit, doplane, laun)
(launch_sat, scra, scut, scuttle_ship, scuttle_land, knockdown) (ac_planedamage, detonate, attack_val, defense_val, air_damage) (msl_intercept, msl_launch_mindam, pln_prewrite, shp_prewrite): Simplify unit destruction: just zero efficiency, leave makelost() etc. to the prewrite callback.
This commit is contained in:
parent
1b94ddedc3
commit
0c1bd8e98b
14 changed files with 26 additions and 98 deletions
|
@ -244,9 +244,7 @@ scra(void)
|
|||
putland(land.lnd_uid, &land);
|
||||
}
|
||||
}
|
||||
makelost(EF_SHIP, item.ship.shp_own, item.ship.shp_uid,
|
||||
item.ship.shp_x, item.ship.shp_y);
|
||||
item.ship.shp_own = 0;
|
||||
item.ship.shp_effic = 0;
|
||||
putship(item.ship.shp_uid, &item.ship);
|
||||
} else if (type == EF_LAND) {
|
||||
eff = item.land.lnd_effic / 100.0;
|
||||
|
@ -312,9 +310,7 @@ scra(void)
|
|||
putplane(plane.pln_uid, &plane);
|
||||
}
|
||||
}
|
||||
makelost(EF_LAND, item.land.lnd_own, item.land.lnd_uid,
|
||||
item.land.lnd_x, item.land.lnd_y);
|
||||
item.land.lnd_own = 0;
|
||||
item.land.lnd_effic = 0;
|
||||
putland(item.land.lnd_uid, &item.land);
|
||||
} else {
|
||||
eff = item.land.lnd_effic / 100.0;
|
||||
|
@ -323,9 +319,7 @@ scra(void)
|
|||
sect.sct_item[I_LCM] += pp->pl_lcm * 2 / 3 * eff;
|
||||
sect.sct_item[I_HCM] += pp->pl_hcm * 2 / 3 * eff;
|
||||
sect.sct_item[I_MILIT] += pp->pl_crew;
|
||||
makelost(EF_PLANE, item.plane.pln_own, item.plane.pln_uid,
|
||||
item.plane.pln_x, item.plane.pln_y);
|
||||
item.plane.pln_own = 0;
|
||||
item.plane.pln_effic = 0;
|
||||
putplane(item.plane.pln_uid, &item.plane);
|
||||
}
|
||||
pr(" scrapped in %s\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue