Commit graph

1926 commits

Author SHA1 Message Date
2ae6be9af6 (num_teles, redir_fp, pipe_fp, exec_fd, sendeof, prompt, command)
(ac_intercept, all_missiles, ac_planedamage, ac_doflak, ac_landflak)
(ac_shipflak, ac_fireflak, can_fly, do_evade, att_calcodds)
(emp_setbitmap, lnd_hit_mine, conditions, get_wp, daemonize): Internal
linkage.
2006-05-20 13:54:45 +00:00
aac6312c74 (makeqt): Unused, remove. 2006-05-20 13:41:24 +00:00
e2f3f6839e (ioq_init): Initializing num_teles[] here is unmodular. Remove, as
default initialization is fine.
2006-05-20 13:40:56 +00:00
dd4a175532 (tfactfire): Unused since src/lib/subs/landgun.c rev. 1.12, remove. 2006-05-20 13:02:40 +00:00
d906fd6b99 DEFENSE_INFRA was implemented in an odd way: sct_defense was used
regardless of the option, but forced to sct_effic when disabled.  This
screws up sct_defense when you disable DEFENSE_INFRA.  Implement it
more like FALLOUT: use sct_defense if enabled, else sct_effic.  The
change should be invisible except in xdump, which shows the real
sct_defense.  Closes #804641.
(SCT_DEFENSE): New.
(dump, sinfra, sector_strength): Use it.
(eff_bomb, build_bridge, build_tower, new, buildeff, sect_damage)
(put_combat, checksect, produce_sect): Don't force sct_defense to
sct_effic when DEFENSE_INFRA is disabled.
2006-05-20 11:53:20 +00:00
499e19f97b (improve): Fix unsafe use of opt_DEFENSE_INFRA as array subscript. 2006-05-20 11:04:00 +00:00
d5eee2175b (nati): Remove weird code to round max safe population that has no
effect unless your floating-point arithmetic is hopelessly broken.
This code appeared in Chainsaw 3.2 or so.  Also remove some redundant
casts.
2006-05-20 08:43:24 +00:00
89cd9b7ca0 (EF_NATION_REJECTS, nation_rejects): New.
(empfile): Add it.
(nat_ca): Use it.
2006-05-18 19:42:23 +00:00
35d14c3e73 (cou_ca, nat_ca, ef_init_srv): Make selectors relations and rejects
visible to mortals in cou_ca[].
2006-05-18 19:20:16 +00:00
75604d817c (nsc_type): New member NSC_HIDDEN.
(meta_type): Add its entry.
(setnum, nstr_promote, nstr_exec_val): Deal with it.  nstr_exec_val()
implements opt_HIDDEN by mapping unknown values to -1.
(natstr, nat_ca): Use it for member nat_relate.  This also halves its
size.  Fixes very minor leak: before, player could see relations to
all countries, regardless of contact.
(nation_relations): Add entry for -1.
2006-05-18 19:02:04 +00:00
6844c94b4a (natstr, add, getrejects, putreject): Simplify rejections storage.
The space savings of nibble storage are not worth the hassle,
especially for xdump.

(nat_ca): New selector rejects.
2006-05-18 18:43:38 +00:00
af9c94d06f SuSE 9.3 reportedly needs -lncurses for setupterm(). 2006-05-18 18:18:45 +00:00
53f5cb861f Bump version to 4.3.4. 2006-05-18 18:10:27 +00:00
58035e0515 Another 4.3.3. change.
Tag 4.0.0 with the date of the r.g.e. announcement.
2006-05-16 21:39:14 +00:00
fee58a3b66 Update for current code. 2006-05-16 20:46:07 +00:00
9e15c62d7d (powe): Simplify.
(gen_power): Remove redundant parenthesis.
2006-05-16 20:06:24 +00:00
5258e63b48 Fix rev. 1.31. 2006-05-16 19:54:33 +00:00
6e3b478377 (powe): Rewrite computation of targets[] for power c using
snxtitem()/nxtitem(), for simplicity and more uniform syntax.  Country
names no longer work when specifying more than one country (snxtitem()
restriction).  As usual with nxtitem(), silently ignore unsuitable
items (the old code complained and failed).  Don't skip powerless
countries for power c.  Closes #1025607.
(set_target): Unused, remove.
2006-05-16 18:59:19 +00:00
6e148e3176 Fix markup. 2006-05-16 18:46:04 +00:00
b2408762cd Update for 4.3.3. 2006-05-14 19:35:40 +00:00
c332cfd460 Provide example, fix pasto. 2006-05-14 19:33:43 +00:00
568766dce6 (shiprepair, planerepair, landrepair): Simplify materials code. No
functional changes.
2006-05-14 18:26:25 +00:00
4ae17ff922 (shiprepair, landrepair): Always return 1. Change to return void.
Simplify callers.

(prod_ship, upd_ship, prod_land, upd_land): Move test for mineff.

(upd_land, feed_land): Move food resupply.

(landrepair): Don't putsect(), update code works directly on cache.
2006-05-14 18:23:44 +00:00
851e63ef05 (upd_plane, planerepair): New, factored out of prod_plane(). No
functional changes.
2006-05-14 18:13:55 +00:00
917d715c8c (prod_plane): Simplify carrier repair code. Oops on bad carrier. 2006-05-14 18:09:33 +00:00
f60efaca4e (prod_plane): Rename plp to pcp, remove redundant desc. Tally build
cost without rounding, like ships and land units do.
2006-05-14 17:54:52 +00:00
85e7e3c9d4 (prod_plane): Simplify test for moving satellite. 2006-05-14 17:40:00 +00:00
a50ae4a3d8 (effrange, torprange, fortrange): New.
(multifire, quiet_bigdef, torp, anti_torp, sd, sb)
(lnd_fort_interdiction, lnd_support, perform_mission, oprange)
(shp_fort_interdiction): Use them.  This fixes forts shooting below
FORTEFF in quiet_bigdef(), lnd_fort_interdiction() and
shp_fort_interdiction().  Change variables for rounded ranges to int.

(quiet_bigdef, sd): Don't scale ship firing range by efficiency.

(dd, sb): Simplify.

(sb): Internal linkage.

(perform_mission): Rename range2 to vrange.
2006-05-14 14:06:00 +00:00
5b4b3a13cb Break lines more tastefully. 2006-05-14 07:52:20 +00:00
fcc0162188 (nuke): Players need the uid to work with nukes, show it. Show
members introduced in nuke.h rev. 1.19 and 1.20: nuk_plane, nuk_effic,
nuk_tech, nuk_stockpile.  Make output similar to the other unit
reports while we're at it.
2006-05-13 15:30:30 +00:00
89694cd468 (detonate): Change parameters from carrying plane to nuke and
airburst.  Leave taking nuke off the plane to caller.  Use coord for
coordinate parameters.
(pln_damage): Take nuke off the plane.

(detonate): Destroy the nuke.  This is required since arming doesn't
remove nukes from the nuke file anymore (arm.c rev. 1.15).
2006-05-13 14:04:03 +00:00
324e52fa9d (nuk_postread): Update nuke location to match that of the plane
carrying it.  This is required since arming doesn't remove nukes from
the nuke file anymore (arm.c rev. 1.15).

(nuk_prewrite): Properly destroy nuke.  This is required since nuke
file contains individual nukes instead of stockpiles (nuke.h
rev. 1.19).
2006-05-13 13:41:02 +00:00
f70b64d91b (coun_cmd): Multiple client commands could overrun player->client[].
Reported by Luigi Auriemma.
2006-05-13 07:56:12 +00:00
256025736c Remove unused variables. 2006-05-13 07:44:52 +00:00
0fd82cf1d7 (look_land): Use roundintby() instead of ldround() for int argument. 2006-05-13 07:43:59 +00:00
9b14771d69 Remove redundant casts. 2006-05-13 07:42:18 +00:00
75e35f932f (knockdown): Destroy nukes on collapsing bridges. Before, you could
rescue them by building a new bridge or arming them on naval planes.
2006-05-13 07:24:10 +00:00
75363a0525 (pln_prewrite): Destroy nuke along with the plane carrying it. This
is required since arming doesn't remove nukes from the nuke file
anymore (arm.c rev. 1.15).
2006-05-13 07:22:47 +00:00
995c7c6bf3 (player_coms): Break lines more tastefully. 2006-05-13 07:16:59 +00:00
29c61d574c (bp_lbcost): Don't convert the cost from double to float and back.
Simplify.
2006-05-07 09:19:21 +00:00
97be5018e2 (hap_req): New.
(nati, populace): Use it.

(populace, nati): Change hap, pct from float to double, because they
are used as double.

(nati): Print happiness needed with just two decimals, like the other
levels.
2006-05-06 11:07:35 +00:00
222847bb75 (fuel): Change extra from float to double, because its value is always
computed and used in double.
2006-05-06 09:02:03 +00:00
8646d6f6d0 (build_ship, build_land, build_plane): Compute initial efficiency in
double rather than float, because all its uses convert it to double.
Remove redundant casts.
2006-05-06 08:44:12 +00:00
276cbc54d2 (comm_bomb): Compute damage percentage in double rather than float,
because all its uses convert it to double.
2006-05-06 08:41:01 +00:00
f819e7ac85 Do not cast to float where default argument promotion obviously
converts the cast's result to double.  Such casts are ugly and may
lose precision.
2006-05-06 08:34:33 +00:00
7a99405942 Do not cast to float where usual arithmetic conversions obviously
convert the cast's result to double.  Such casts are ugly and may lose
precision.
2006-05-06 08:26:31 +00:00
802f69b039 (nukstr): Make it a struct genitem: add members nuk_effic, nuk_mobil,
nuk_tech, nuk_stockpile, nuk_opx, nuk_opy, nuk_mission, nuk_radius.
These have no effect, yet.
(build_nuke): Initialize them.
(nuke_ca): Add genitem selectors: effic, mobil, tech, group, opx, opy,
mission, radius.
(tran_nuke): Zap mission, just in case somebody invents missions for
nukes.
(trade_desc): Show tech and efficiency, for consistency with other
units.
2006-05-06 07:37:00 +00:00
2e40a4bb90 Change nuke storage and commands to match other units:
(nukstr): Hold one nuke instead of a stockpile: replace members nuk_n,
nuk_types by nuk_type, nuk_plane.  Add nuk_land for completeness, like
nuk_ship it's not yet used.
(nuke_ca): Update accordingly: replace selectors number and types by
type and plane.
(build_nuke): Update accordingly.
(ndump, nuke): Update accordingly.  Output is no longer sorted by
location, and nukes in same location no longer share id.  nuke's extra
columns for nuclear plants are repeated for every nuke.
(trade_desc): Update accordingly.
(cede, grab_sect, check_nuke_ok, detonate, trade_nameof): Talk about
nukes instead of nuclear stockpiles.
(arm, disarm): Rewrite, split off new disarm().  Don't remove nuke
from the nuke file on arm.  Allow usual plane syntax, not just plane
number.  Change second argument from nuke type to nuke number.  When
plane is already armed, ignore nuke argument and rearm (broken in
4.2.6).
(tran_nuke): Update for changed struct nukstr, make as similar as
possible to tran_plane.  Change syntax to match transport plane.
(player_coms): Update arm, disarm and transport accordingly.
(prnuke, nuk_on_plane): New.
(nuk_add, nuk_delete): Stockpile management, remove.
2006-05-06 07:20:21 +00:00
e86beb9626 Don't wrap global variables in a struct for no reason:
(LwpMaxfd, LwpNfds, LwpReadfds, LwpWritefds, LwpFdwait, LwpDelayq)
(LwpSelProc): New, matching members of LwpSelect, internal linkage.
(lwpSelect, LwpSelect): Remove.
2006-05-06 06:16:53 +00:00
87c3790169 (lwpReschedule): Use CANT_HAPPEN() and abort() instead of lwpStatus()
and exit() for fatal internal errors.
2006-05-01 17:10:50 +00:00