Commit graph

3337 commits

Author SHA1 Message Date
1ec0dc976a Doc fix for commit 7ca4f412 2008-08-19 08:54:05 -04:00
5c4963c464 Make snxtsct_area() expect correct range width and height
snxtsct_area() computed width and height, overwriting the values
passed in, even though all but two callers passed correct values.  The
exceptions were snxtsct() in case NS_ALL, and snxtsct_all().  Change
them to pass correct values, and drop the recomputation from
snxtsct_area().  Simplifies the interface between snxtsct_area() and
its callers.
2008-08-19 08:54:05 -04:00
bf9389a7a9 Clean up and simplify snxtitem_dist() and snxtsct_dist()
No functional change.
2008-08-19 08:54:05 -04:00
d17f33d138 Oops on funny xysize_range() arguments
Comments claimed funny arguments could happen.  I don't think so.
2008-08-19 08:54:04 -04:00
3ca882714d Fix computation of map buffer indexes
The correct method to compute indexes into a map buffer for a struct
range is deltx(), delty().

path() used deltax(), deltay() instead, which yield correct results
only for indexes up to half the world size.  Pathes spanning larger
areas were screwed up.

sona(), radmap2(), satmap() also used deltax(), deltay(), but only
with arguments where those yield correct results.

draw_map() used xnorm(), ynorm() instead, which is correct, but less
clear and less efficient.
2008-08-19 08:54:04 -04:00
42a8b315e5 Fix deltx() for x < r->lx && r->lx < r->hx; likewise delty()
Bug couldn't bite, because callers pass only coordinates within the
interval.
2008-08-19 08:54:04 -04:00
6830c80341 Remove some useless code from nav_map() 2008-08-19 08:54:04 -04:00
Ron Koenderink
6dadcd0976 Build ecomony for player 8 2008-08-18 21:21:46 -06:00
Ron Koenderink
8319414b01 Explore player 8's island
Explore the player 8's island in preparation for
island development and future war with player 1.
2008-08-17 15:54:21 -06:00
Ron Koenderink
b6c2d5bfa9 Add additional tests to nightly build
The following tests were added:
bridge building
spy
radar (ship, sector)
look
convert
In additon, prepartion for testing research and
hapiness production was added and improvements
for general economy for player 1 were added.
2008-08-17 15:51:40 -06:00
Ron Koenderink
851ccd4876 Fix timestamps for data files and lost command
Set the ef_timestamp to 100 for the nightly build.
Set the DUMP LOST timestamp to 101 for the nightly build.
This will the suppress the timestamp differences
that occur when testing lost command and will facilitate
testing for dump and xdump commands.
2008-08-17 15:13:57 -06:00
8c404f5b7f Bump version to 4.3.17 2008-08-15 07:52:36 -04:00
Ron Koenderink
047b4b1983 Add additional tests to nightly build
The following tests were added:
ship list
ship navigation
assault
tech production
sector lost
commodity monitoring
tech monitoring
education monitoring
2008-08-09 15:05:40 -06:00
Ron Koenderink
931f6db90d Add change directory before starting server tests
The server tests would fail if the previous
steps were skippped.
2008-08-09 14:59:59 -06:00
fac3049bc2 Update change log again for 4.3.16 2008-08-09 12:10:06 -04:00
358de131f7 Fail announce, pray, telegram and turn on aborted telegrams
Change tele() and turn() to return RET_FAIL when getele() fails.
Before, tele() returned RET_OK then, and turn() returned RET_SYN.
2008-08-09 12:10:06 -04:00
a532c76428 Fix recently changed command failures to use BTUs
Failing a command with code RET_SYN prints help and doesn't charge
BTUs.  Failing with code RET_FAIL doesn't print help and charges BTUs.

A couple of command failures were changed or added recently to fail
with RET_SYN, because they're due to invalid player input.  Some of
them, however, can happen after the command already did something, so
BTUs must be charged, or else players can deliberately fail the
command to save BTUs:

* Commit 9eda5f87 adds RET_SYN failures when getting player input
  fails for:

  - arm third argument
  - deliver fourth argument
  - fire third argument
  - lmine second argument
  - order d fourth argument
  - range second argument
  - sail second argument
  - tend third argument

* Commit be41e70f likewise for:

  - designate second argument
  - morale second argument
  - set third argument
  - tend fourth argument

* Commit d000bf92 likewise (with a bogus commit message) for bdes
  second argument.

* Commit 9f4ce71a likewise for ltend third and fourth argument.

* Commit 9031b03b changes failure code from RET_FAIL when getting
  player input fails for threshold third argument.  It adds RET_SYN
  failure when the argument is bad.  Some bad arguments already failed
  that way before.

* Commit a7cf69af changes it from RET_FAIL when designate second
  argument is bad.

Change them all to fail with RET_FAIL.

Many other places have the same bug, but those are left for another
day.
2008-08-09 12:09:50 -04:00
c7d2144154 Fix production command not to limit level production to 999
Item production is limited to 999 units, level production is
unlimited.

Commit 0e721173 (v4.2.15) changed prod() from no limit to 999 units,
which fixed it for items, and broke it for levels.  Undo the change
for levels.
2008-08-09 09:03:03 -04:00
aee8272d3d Give some identifiers internal linkage
Give draw_map(), xdeval(), LwpSchedQ[], LwpDeadQ, LwpContextPtr,
LwpMaxpri, LwpStackGrowsDown internal linkage.
2008-08-09 08:40:04 -04:00
0a49cd24a3 Remove unused xdprval() 2008-08-09 08:40:04 -04:00
e628c50b21 Fix work not to claim an engineer worked when it didn't 2008-08-09 08:40:04 -04:00
063a7d9988 Fix work command to round mobility use randomly, not down 2008-08-09 08:40:04 -04:00
ab2893fa41 Fix work command not to spend more mobility than requested
Culprit is careless rounding in work().
2008-08-09 08:40:04 -04:00
3615cfc8ac Don't permit work command to spend more money than available
Stop work() when there's not enough money left for the current
engineer.
2008-08-09 08:40:04 -04:00
ede42fb9ce Improve work()'s message when sector doesn't need construction
The cheesy test for repeated messages broke down when working on more
than one sector.  Reword the message so that repetition is fine, and
drop the test.
2008-08-09 08:40:04 -04:00
c20ac26ecc Fix improve not to spend more money than available
improve() attempted not to spend the last dollar, but screwed up when
improving more than one sector.  This could bankrupt the player.

Replace the flawed code by the same simple method that is used
elsewhere: break the loop when there's not enough money left for the
current sector.
2008-08-09 08:40:04 -04:00
4b696a5c30 chkmoney() is no longer used, remove it 2008-08-09 08:40:04 -04:00
82c916654c Don't permit convert to spend more money than available
Complicated by the fact that conv() ran the conversion code twice,
first for adding up the cost for chkmoney(), then for actually
converting.  chkmoney() asks the player to confirm when he's about to
spend more than half his cash.  Get rid of that, not worth the
complexity.  This merges do_conv() back into conv().
2008-08-09 08:38:07 -04:00
cc4cf23273 Don't permit demobilize to spend more money than available
Complicated by the fact that demo() ran the demobilization code twice,
first for adding up the cost for chkmoney(), then for actually
demobilizing.  chkmoney() asks the player to confirm when he's about
to spend more than half his cash.  Get rid of that, not worth the
complexity.  This merges do_demo() back into demo().

It also removes the command's virtually undocumented fourth argument.
Update player_coms[] accordingly.  While there, make it require money;
it won't do anything useful without money anyway.
2008-08-09 08:34:00 -04:00
2434d2c8ee Change nav_ship() not to use RET_OK and RET_SYN as return values
These are only appropriate for commands and their helpers.
2008-08-03 12:18:14 -04:00
29aefc356f Get rid of RET_SYS, just use RET_FAIL
RET_SYS was used for commands failing due to internal or environmental
errors, but not really systematically.  The difference to RET_FAIL is
how dispatch() treats them: RET_SYS got logged, and cost no BTUs.

More specific logging is possible at the point of failure than in
dispatch().  Make sure that's done for all failures that used to
return RET_SYS.

The change in BTU charging affects commands consider, offer, repay,
trade failing due to internal errors.  It also affects deity commands
reload and turn (irrelevant because deities get unlimited BTUs), and
commands apropos, info and motd (irrelevant because they cost no
BTUs).
2008-08-03 11:34:00 -04:00
e803950463 Fix error return value of nav_loadship()
Used RET_SYS as an error value, which is bogus; caller interprets
non-zero as "all loaded".  Return zero instead.
2008-08-03 10:25:48 -04:00
ed9da7cf06 Update known contributors comments 2008-08-03 08:04:08 -04:00
4ac09a3cd9 Update change log for 4.3.16 2008-08-02 21:29:48 -04:00
5c18d33e21 Make ship_bomb() friendlier
Behave like plane_bomb() and land_bomb(): deal with leading whitespace
and signs in the input, print a message when asked to bomb a ship that
is not there.
2008-08-02 21:25:31 -04:00
278c3fe2d8 Simplify control flow in ship_bomb(), plane_bomb(), land_bomb()
No functional change.
2008-08-02 21:25:31 -04:00
fcb9c7f546 Remove key 'd' at bomb ship, plane and land unit target prompts
Key 'd' has always been there, but never documented.  Key '~' does the
same, and the prompt mentions it since 4.2.2.  Drop 'd'.
2008-08-02 21:23:07 -04:00
bc805ba81a Fix land unit flak when pin-bombed to match flak when overflown
land_bomb() failed to reduce flak proportional to efficiency.  Missed
in commit c7f68f2e, v4.3.6.

Also change it to round randomly instead of down, to match
ac_landflak().
2008-08-02 18:12:58 -04:00
6a95e67e4f Don't permit bombing of embarked planes and land units
Change planesatxy() not to list embarked planes, plane_bomb() not to
bomb them, and land_bomb() not to bomb embarked land units.

Curiously, embarked land units were not listed as targets before, but
could be bombed all the same.
2008-08-02 17:28:05 -04:00
3a9545fe99 Remove redundant and misleading stuff from info bomb 2008-08-02 17:17:08 -04:00
b7c7fa00e1 Fix capital maintenance to charge at 60% efficiency
produce_sect() started to charge at 61%.  Has always been that way.
2008-08-02 15:46:35 -04:00
def5ef11ff Make launch command require only 40% plane efficiency
This is to make it consistent with automatic missile launch.
2008-08-02 15:03:44 -04:00
132b20434d Disable collateral damage for automatically launched missiles
4.0.17 made missiles that miss their target do collateral damage to
the target sector.  The code didn't work: it did collateral damage
even when the launch failed or the missile got intercepted.  4.0.18
disabled it again for the launch command (see also commit fa7e3aa9).

Disable it for automatically launched missiles, too, in
msl_launch_mindam().
2008-08-02 14:44:54 -04:00
24aaec7e34 Fix a long vs. int format string bug in xdprsym()
Could print junk on machines where long is wider than int, but only in
oops recovery.
2008-08-02 12:04:06 -04:00
1d9aac2cf9 Add gcc attribute format where it's missing 2008-08-02 12:00:33 -04:00
eb252201b6 Fix struct loststr / struct empobj mismatch corrupting lostitems
The initial parts of struct loststr and struct empobj must match.
Commit 49780e2c screwed that up for members lost_uid/uid, which also
broke the equivalence of lost_owner/own.  Since lost_uid is not used,
the former had no effect.  But the latter broke xdvisible().  Could
make xdump lost leak information.

Commit a680c811 reorderd struct loststr members to make lost_timestamp
equivalent to new struct empobj member timestamp, but failed due to
the bug in commit 49780e2c.  Commit f33b96b1 then set the timestamp
through empobj, which screwed up timestamps in lostitems, i.e. it
broke incremental xdump lost.

All of the above is in v4.3.12.

Commit 536ef0b0 (v4.3.15) added lost_seqno / seqno.  No effect,
because only seqno is used.
2008-08-01 08:50:24 -04:00
e58be3179a Remove product information from show sect c
New show product made this redundant.
2008-07-28 07:52:32 -04:00
acf7f6c1ce Always print header in show_sect_stats() and show_sect_capab()
Simpler, and empty tables are highly unlikely anyway.
2008-07-28 07:52:32 -04:00
71bbd642df New show product
This is the human-readable buddy of xdump product, which dumps pchr[].
It duplicates much of the information in show sect c, but in more
accessible form.  It's in show_product().

Remove product information from info Quick-ref.  show reflects the
actual game, is more complete, and should be just as readable.
2008-07-28 07:51:49 -04:00
ae8c4620b0 Show sector navigability in show se s
This is the human-readable buddy of xdump sect-chr column nav, which
dumps ichr[].d_nav.
2008-07-27 21:04:44 -04:00