Commit graph

2398 commits

Author SHA1 Message Date
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
6d4d5f7abf (lwpSelect): Use logerror() instead of lwpStatus() to report fatal
error.
2006-05-01 17:10:11 +00:00
7ed308526c Remove redundant casts of argument to (prototyped) double parameter. 2006-05-01 12:34:16 +00:00
7c3899bf89 (starve): Prompted twice for sectors when first argument was empty,
fix.  Simplify.
2006-05-01 06:52:48 +00:00
d26c84ee36 (increase_mob): Call time() just once, the second call can only
introduce inaccuracy.  Simplify the loop; it still doesn't make much
sense.
2006-04-30 18:38:52 +00:00
5f94d9a651 (find_escorts, perform_mission): Simplify. 2006-04-30 18:31:13 +00:00
e352801820 (fire_dchrg, fire_torp): Simplify. 2006-04-30 18:28:54 +00:00
e94c6e5a3e (gen_power): Simplify. 2006-04-30 18:25:50 +00:00
898c74a80f (get_couval, get_outstand): Remove. Unused since automatic loans were
removed (buy.c rev. 1.18, trad.c rev. 1.15), should have been removed
then.
2006-04-30 18:20:23 +00:00
abc14df544 Reorder function definitions. 2006-04-30 16:35:43 +00:00
0e11700d12 (lload): Simplify. 2006-04-30 16:28:48 +00:00
fdc790db61 (MAX): Remove redundant definition. 2006-04-30 16:26:51 +00:00
ce79ad5a19 Fix another insufficiently parenthesized macro expansion. 2006-04-30 16:25:58 +00:00
6f4a630e9a (buil): Clarify. 2006-04-30 16:20:14 +00:00
ba74075e9a Fix the previous revision. 2006-04-30 16:18:35 +00:00
384555b811 (pln_arm): Change parameter mission from int to char to clearly
document its use.
2006-04-30 16:15:33 +00:00
a292d6f98a Fix insufficiently parenthesized macro expansions. 2006-04-30 16:08:45 +00:00
cee8e126a2 Remove declaration that should have been removed in rev. 1.9. Doc
fix.  register purge.
2006-04-30 13:20:48 +00:00
470cd37056 (sate): Use ef_byname_from() for second argument. 2006-04-30 13:10:34 +00:00
8cb55944a3 (TERR_MAX): New.
(terr): Use it.

(terr): When the territory number is bad, do not loop prompting, just
fail.  That's what the vast majority of commands do.
2006-04-30 12:56:41 +00:00
f59fd6e8eb (retr, lretr): Readability fixes. 2006-04-30 12:52:30 +00:00
901499908c (bomb, drop, fly, para, reco): Simplify. 2006-04-30 12:48:21 +00:00
4074ab02f1 (islist): Simplify. 2006-04-30 12:36:28 +00:00
e28851b8e9 Normalize unsigned int to just unsigned. 2006-04-30 12:26:07 +00:00
e09e6e587b Normalize long int and short int to just long and short. 2006-04-30 12:05:23 +00:00
a358704096 (do_desi): Improve message when designation doesn't exist. 2006-04-30 11:56:01 +00:00
5982d38248 (ask_olist, att_fight): Oops on bad combat mode. Fixes compiler
warnings.
2006-04-30 11:35:53 +00:00
4e85ca6b30 (pr_ship, doship, pr_land, dounit): Remove keys deprecated in
rev. 1.20.

(prsect, doland): Deprecate key 'C'.

(pr_plane, doplane): Deprecate keys 'a' and 'd'.

(pr_land, dounit): Deprecate key 'X'.

(pr_ship, doship): Deprecate keys 'H', 'P', 'X' and 'Y'.

(docountry, dounit): Remove parameter farg.
2006-04-30 09:21:57 +00:00
67408f444e (att_ask_offense, ask_move_in): land_answer[] is indexed by army
character, reduce size accordingly.

(att_prompt, ask_move_in_off): Remove dead code.

(att_reacting_units): Simplify.
2006-04-30 08:53:22 +00:00