Commit graph

2043 commits

Author SHA1 Message Date
15635c25ae (getid): Restrict identifier syntax: outlaw conditional operators <>=#
and meta-character ".
2006-06-01 18:09:40 +00:00
2faa68c6e3 (xufld, setstr): Improve diagnostics. 2006-06-01 18:06:03 +00:00
565b6630a2 (prexpense, budg): Printing brackets around expenses that won't
actually be paid in full didn't take the update sequence into account,
and wasn't implemented for sector building, military payroll and
capital maintenance.  Remove the feature, as fixing is hardly worth
the trouble.  This renders prexpense() trivial; inline and remove.
2006-06-01 17:42:59 +00:00
967299a375 (update_main): Change update sequence to repair ships, planes and land
units after sectors produce.  This makes repairs use new avail instead
of old.
2006-06-01 16:54:00 +00:00
016249c9e5 (land, nuke, plan, shi): Change stop prefix to `!'. Explain it in the
footer when actually present.
2006-06-01 16:29:54 +00:00
b8825e962c (lnd_support): Let land units on missions support, just like ships. 2006-05-31 19:58:16 +00:00
01ed071af4 (att_reacting_units): Don't let units loaded on a train react. 2006-05-31 19:56:02 +00:00
039907d306 Update known contributors comment. 2006-05-29 21:23:33 +00:00
85c8d7bd82 Fix the previous revision. 2006-05-29 21:20:09 +00:00
eb1512d75f Let players stop/start units:
(genitem, lndstr, nukstr, plnstr, shpstr): New members off, lnd_off,
nuk_off, pln_off, shp_off.
(NSC_GENITEM): New selector off.
(land, nuke, plan, shi): Display efficiency prefixed by `=' when off.
(start, stop, player_coms): Rewrite, new syntax.  Print only objects
that actually change.
(start_hdr, stop_hdr, start_stop_hdr): Consolidate.
(item_u, start_stop, start_stop_sector, proff, start_stop_unit)
(start_stop_unit_hdr, unit_type_name): New.
(upd_land, upd_plane, planerepair, upd_ship): Obey and clear stoppage.
2006-05-29 21:11:14 +00:00
520446ef39 Remove budget priorities:
(budg, player_coms): Remove command arguments.
(PRI_SMAINT, PRI_PMAINT, PRI_LMAINT, PRI_SBUILD, PRI_PBUILD)
(PRI_LBUILD, PRI_MAX): Remove.
(natstr): Remove member nat_priorities.
(add, main): Remove its initialization.
(budg, cal_call, prexpense, prod, update_main, upd_land, upd_plane)
(upd_buildeff, produce_sect, upd_ship): Simplify.
(produce_sect): Last parameter now superflous, remove & simplify.
(change_prio, do_prod): Unused, remove.

(budg): Move land units output down, to match update sequence.
2006-05-29 20:43:30 +00:00
26110320c0 Update for current code, and edited for clarity. 2006-05-29 20:06:34 +00:00
2b57a13d94 Change set with nuke.h rev. 1.21 was incomplete (harmless because the
missing bits were consistent):
(build_nuke): Assign 0 instead of space.
(nuke): Update printing of group.
2006-05-29 19:29:29 +00:00
d5f8c32342 (plan): Condense columns LSB and nuke into column special. Rename
column s/l to carry.
2006-05-29 19:11:24 +00:00
9a6016aecc (land): Show carrier number with a type suffix instead of a prefix,
for consistency with nuke and plane commands.
2006-05-29 18:49:14 +00:00
3f02f51469 Bump version to 4.3.6. 2006-05-29 18:39:46 +00:00
bd0bf9fdd3 Update for 4.3.5. 2006-05-28 07:54:10 +00:00
9df65336a9 (landrepair): Simplify. 2006-05-28 07:44:32 +00:00
791d32a58a (nstr_resolve_id): Map identifier ~ to empty string. This makes
intuitive usage like fleet=~ and name=~ work.
2006-05-28 07:37:24 +00:00
0c1bd8e98b (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.
2006-05-27 19:25:12 +00:00
1b94ddedc3 Change encoding of `not in any group' from space to 0, because that's
friendlier in conditionals:
(army, build_ship, build_land, build_plane, doship, doplane, dounit)
(flee, check_trade, wing, snxtitem_group, takeover_ship)
(takeover_land): Assign 0 instead of space.
(carg, lcarg, pr_ship, pr_plane, pr_land, ldump, land, pdump, plan)
(retr, lretr, sdump, shi, lnd_list, shp_list, ask_olist, att_prompt)
(ask_move_in): Update printing of group.

(takeover_plane): Failed to clear wing.
2006-05-27 13:44:18 +00:00
a46de3d997 Clean up rev. 1.44, 1.20 and 1.4. 2006-05-26 19:32:29 +00:00
f3e85c2f70 Coding style, comments, spelling... 2006-05-26 18:46:50 +00:00
109dad1bee (food_needed): New.
(feed_ship, feed_land): Use it.
(do_feed): Use it.  Estimate of food needed was one too large for
integer food needs.  Used to round fractional food need to nearest
instead of up for supply_commod(), which could cause starvation.
(s_commod, get_minimum): Use it.  Estimate of food needed was one too
large for integer food needs.  s_commod() used to reserve one more
than get_minimum() would have returned; it's now the same.

(famine_victims): New.
(feed_people): Use it.  This rounds victim fractions down instead of
up.  It also dosn't flush needs <=1 to zero.  Doesn't change
starvation, as do_feed() always produces at least one emergency food.
Does change food consumption.

(starve_some): New.
(feed_people): Use it.

(feed_ship): Use feed_people().  This rounds victim fractions down
instead of up.

(feed_land): Use feed_people().  Rounding of victim fractions
unchanged.  Feeds all people not just mil; closes #913997.

(starv_people): New.
(starv_sects, starv_ships, starv_units): Use it.  Fixes starve land to
talk about people instead of mil.

(starv_sects): Use famine_victims() rather than feed_people().  Take
emergency food into account, because feed_people() doesn't.  Don't aim
for one extra food, for consistency with starv_ships() and
starv_units().
(feed_people): Remove useless parameter.  Simplify.

(starv_ships, starv_ships): Use famine_victims() rather than
feed_ship() and feed_land().
(feed_ship, feed_land): Remove useless parameters.  Internal linkage.
Simplify.

(feed_land): Call resupply_commod() only if there's a food shortage.
Don't scrounge lnd_ship for food, resupply_commod() already does.
2006-05-26 18:22:42 +00:00
0ac31b3ece (ask_olist): Fix rev. 1.45. The bug makes it impossible to assault or
board with land units.
2006-05-26 17:53:53 +00:00
d723532add Bump version to 4.3.5. 2006-05-26 05:09:00 +00:00
56181c1986 The previous revision of Make.mk didn't work with separate build
trees.  Do it in a way that does.
2006-05-25 08:18:20 +00:00
edbf6b0061 4.3.4 last minute changes. 2006-05-25 05:48:58 +00:00
8a81c5b404 Autoconfigure NROFF. Traditional nroff now works in addition to
groff.
2006-05-24 19:56:13 +00:00
b01382cdcc Don't use -I with $(NROFF), old versions of groff and traditional
nroff don't support it.
2006-05-24 19:55:05 +00:00
320a265d2f (natstr): Remove unused member nat_spare[]. 2006-05-24 18:33:28 +00:00
cc1df4e88a (verify_fail): New parameter idx. Use it to print array index when
applicable.  Callers changed.
2006-05-24 18:32:13 +00:00
46a7a9c17f SuSE 9.3 reportedly needs -lncurses for setupterm(). 2006-05-24 18:26:34 +00:00
1fad65964f Update for 4.3.4. 2006-05-23 18:14:17 +00:00
c7d41b3f98 Document need for curses. 2006-05-23 18:04:11 +00:00
ee53725a21 (prmptrd, uprmptrd): Oops on null prompt. getstarg() is sometimes
called with a null prompt when it is believed not to use it, and that
belief is sometimes wrong.  Other users could have similar bugs.  Some
systems (GNU, Windows) deal gracefully with printing null strings,
others crash.
2006-05-23 06:04:55 +00:00
93b6a54356 (nat_ca, cou_ca, ef_init_srv, xdvisible): Plug major information leak:
nat_ca[] was designed for visibility to the owner only, while cou_ca[]
was designed for the public.  xdvisible() implemented that for xdump.
But selectors don't care for that!  Since nat_ca[] applies to
EF_NATION, it must be for public visibility.  Broken in 4.2.21.  Fix
by exchanging contents of nat_ca[] and and cou_ca[].  This breaks
clients relying on xdump.
2006-05-22 20:59:11 +00:00
Ron Koenderink
548bc5bbdc (command): Remove unused local variable i. 2006-05-22 20:37:20 +00:00
df3786ac40 (command): Don't fold conditionals to lower case. This was added
early in Chainsaw 3, most probably to make them case insensitive.
This is of debatable utility, and inconsistent with the case
sensitivity of commands and arguments.  It also interferes with string
conditionals: fleet#A is folded to fleet#a, which means something
else!
2006-05-22 20:04:54 +00:00
13cd9081da Minimize redundancy between (mortal's) xdump nation and xdump country:
(ef_init_srv): Make NSC_DEITY in cou_ca mirror ~NSC_EXTRA in nat_ca,
except for cnum, which may not have either flag in either table.
(nat_ca): Make selectors stat, cname, passwd, xorg, yorg, relations,
contacts and rejects NSC_EXTRA.
2006-05-22 19:58:44 +00:00
a8e2df3ad8 (edit): Crashed when country argument didn't name a country. Fix &
simplify.  Reported by Pat Loney.
2006-05-22 18:51:24 +00:00
Ron Koenderink
44a5e5d65a (nuke): Removed unused local variable. 2006-05-22 17:23:31 +00:00
Ron Koenderink
263927cb7e (att_get_offense): Remove unused local variables. 2006-05-22 17:22:28 +00:00
0e14911d72 Rev. 1.26 screwed up return value for building, which was visible in
output of budget.  Reported by Stefan Hauser.
2006-05-21 20:24:36 +00:00
ba578e0e23 (nstr_resolve_id): Resolve ambigous name into string if string_ok.
(nstr_comp_val): Break long line.
2006-05-21 20:05:50 +00:00
433f223a14 (NSC_GENITEM, ship_ca, plane_ca, land_ca): Change selectors group,
fleet, wing and army from numbers to user-friendly strings.  This
makes ?fleet#'a' work.  Closes #928405.
2006-05-21 17:25:40 +00:00
0d842c47f7 Purge the register keyword. 2006-05-21 13:18:57 +00:00
4c4fdca42b Line breaks and other formatting issues. No functional changes. 2006-05-21 13:05:24 +00:00
281840b604 (pln_hitchance): Change tfact from float to double, because it is used
as double.
2006-05-21 13:03:40 +00:00
cd73a47dfa Remove superflous casts and parenthesis. 2006-05-21 12:24:30 +00:00