Commit graph

459 commits

Author SHA1 Message Date
20199b2236 (drop, fly): Fix previous rev. not to prohibit flying civilians to an
ally.  Since you can load them onto their ships, you should be able to
fly them over.
2004-08-16 14:35:06 +00:00
98a7936c08 Update for 4.2.17. 2004-08-14 20:03:08 +00:00
Ron Koenderink
1fcc9f68fd Added srand call to thread startup as each thread needs to be seeded in Windows. 2004-08-14 19:35:38 +00:00
d993fdef90 (pln_mine, pln_dropoff): Split off aerial mining into new pln_mine().
Callers changed.

(drop): Do not disclose anything about target sector before planes
actually got there, unless the target sector is owned by the player or
an ally.  This plugs a major loophole.  Consequently, the command can
no longer always refuse to attempt to drop stuff where it won't work.
Instead, the planes fly out to try.  Other plane commands (para, bomb)
behave exactly the same.  Also closes #909859.
(pln_dropoff): Cope with planes trying to drop where they can't.

(drop): Refuse to drop civilians into allied sectors, for consistency
with other means to move around stuff.
2004-08-14 17:12:20 +00:00
003e068615 Making directories worked only when CVS was the first sub-directory
found by find.
2004-08-14 08:23:37 +00:00
3588722250 (fly): Prohibit flying of civilians into occupied or allied sectors.
Before, civilians magically changed allegiance on disembarking planes.
2004-08-14 07:27:05 +00:00
a878a40a7b (fly): Failed to re-get target sector after asking for cargo, and thus
passed potentially invalid argument to pln_onewaymission().
2004-08-13 21:00:11 +00:00
1127762cc1 (pln_oneway_to_carrier_ok): New.
(fly, reco): Use it to prevent flying to a carrier that doesn't have
space for the planes.  Previously, planes that did this were
teleported home, which could be abused.

(fly): Fail if pln_sel() comes up empty, just like the other commands
to fly planes.
2004-08-13 20:22:03 +00:00
ab0d5a87bd (bomb): Don't tell the player that target is a sanctuary before his
planes got there.  This closes a loophole that allowed players with
any planes to find all sanctuaries.
2004-08-13 12:02:35 +00:00
73308d9c57 (move, explore): Return early when interdiction destroys everything
moved.  Without that, loyalty computation divided by zero and crashed
when moving civilians to a sector without civilians.  Found and
debugged by Jeff Cotter.  Closes #1005005.
2004-08-13 10:05:32 +00:00
9549adefdc No C99/C++ comments. 2004-08-13 09:57:58 +00:00
a5a8b52afd (gamedown): Printed down message with pr(), as a printf()-like format
string!  This reads and formats junk from the stack when message
contains '%', and can even crash.  Use prnf() instead.  Catched by Ron
Koenderink.
2004-08-10 13:34:41 +00:00
298ba998e4 (infect_people): Use max_pop() to compute space. This makes all
crowded sectors equally vulnerable, including mountains, plains, and
inefficient big cities.  Closes #917488.
Update info.
2004-08-10 07:56:34 +00:00
d721ba3b5c (show_motd): Printed motd with pr(), as a printf()-like format string!
This reads and formats junk from the stack when motd contains '%', and
can even crash.  Use prnf() instead.
2004-08-10 05:52:58 +00:00
Ron Koenderink
743be658c8 Don't drill (and deplete) more oil than the ship can hold.
Closes #955071.
2004-08-05 01:32:09 +00:00
8ce25abc1f (sarg_xy, sarg_getrange, sarg_range, sarg_list): These choke on
trailing junk since the previous rev.  That's too strict.  Silently
ignore trailing junk as long as it starts with whitespace.  That's
somewhat lax, but will do for now.  Closes #982018.
2004-08-04 20:04:37 +00:00
c8afd40eb8 (nstr_comp_val): Since rev. 1.10, selectors were always preferred to
type literals, unless type inference rejects the selector.  This
doesn't work for NSC_TYPE selectors: `?des=n' is interpreted as
`?des=newdes'.  Prefer type literal to NSC_TYPE selector.  Closes
#982021.
2004-08-04 14:47:24 +00:00
Marc Olzheim
153595a253 Now that src/scripts/nightly/patches/All/prng.patch:1.5 makes sure that
all randomness is predictable and repeatable, we're ready for some
real scripts.
2004-06-20 17:58:10 +00:00
Marc Olzheim
b464a4876e Four calls to random() fixed that escaped my previous patch to
emp_random().
2004-06-20 17:42:51 +00:00
Marc Olzheim
99187cd5fd Always seed with '1' instead of the supplied value of emp_srandom()
fot the nightly build.
2004-06-20 17:14:56 +00:00
Marc Olzheim
7877507f25 Make it possible to skip steps of the build by specifying so in the
environment variable "NIGHTLY_SKIP_STEP", making it easier to debug
problems in the build.
2004-06-20 16:36:51 +00:00
Marc Olzheim
58c93d2557 Instead of patching Make.sysdefs, introduce emp_{,s}random() and patch
all files to use it.  Output from the nightly build machines should
now be the same for the different platforms.
2004-06-20 15:30:41 +00:00
Marc Olzheim
788bae6c01 Use non-standard port for the nightly servers, so that the servers
do not conflict with other possible test servers.
2004-06-20 14:08:42 +00:00
Marc Olzheim
6e63f30d9f Make emp_client shut up about TERM variable. 2004-06-20 14:01:20 +00:00
Marc Olzheim
d35f51be90 Actually use the RANDOM defines and define NIGHTLY. Code is patched
into src/lib/gen/chance.c
2004-06-20 14:00:31 +00:00
Marc Olzheim
17c4546ec6 Make sure that the same prng is used on all systems, namely *rand48().
For now, only fairland.c is "fixed".  We'll have to patch the random
calls in the server to use the RANDOM and SRANDOM macros to make
things completely reproducible.
2004-06-19 13:54:49 +00:00
e68dba6d23 Update for 4.2.16. 2004-06-16 19:03:41 +00:00
Marc Olzheim
4c7eca14b5 Remove spurious "Clean sandbox"... 2004-06-16 18:54:36 +00:00
Marc Olzheim
d5b00ca908 Always report 0 minutes login time and 640 btus to ease diff-ing. 2004-06-16 18:32:46 +00:00
Marc Olzheim
5c4ec39dd2 Use "Thu Jan 1 00:00:00 GMT 1970\n" as output for the ctime() hack,
instead of an empty string.
2004-06-16 18:19:40 +00:00
1e6c4a7a5e New, more comprehensive guidelines. Compiled existing Empire
practice, rounded off with classical C usage, edited into a readable
form.  Work in progress.
2004-06-16 18:18:08 +00:00
Marc Olzheim
3629f0fe1e First step to add testing of the server to the nightlybuild.
For now, just some simple checks are added.
2004-06-16 16:06:17 +00:00
Marc Olzheim
7db0d77710 Patch to make ctime return "" for ease test output diff-ing. 2004-06-16 16:04:31 +00:00
d2dc791e44 (upd_buildeff): Previous revision broke work after sector
construction.  Closes #972065.
2004-06-15 19:52:14 +00:00
b4381d0218 4.2.15 last minute changes. 2004-05-26 17:57:40 +00:00
73ad7c07eb Poorly structured and not entirely accurate. Rewrite. Closes
#934465
2004-05-26 17:54:14 +00:00
d77b67fc39 Didn't quite match the code and was confusing. Rewrite. 2004-05-26 17:53:37 +00:00
cf991ed5ea Fix missing include. 2004-05-17 06:15:31 +00:00
eb9d384111 (nstr_comp): Fix handling of condition type mismatch. This bug could
trigger oopses in nstr_exec().

(cond_type_mismatch): Clearer diagnostic message.
2004-05-16 20:14:59 +00:00
654799a8b0 (rada): Fix embarrassing coding error in previous rev. 2004-05-16 16:40:28 +00:00
f1e87e3542 Update for 4.2.15. 2004-05-16 15:00:22 +00:00
a28c6e4373 (doship, doplane, dounit): Fix warnings introduced by previous rev. 2004-05-16 14:24:57 +00:00
c2debd73fc (shp_set_tech, pln_set_tech, lnd_set_tech): New, factored out of build
and upgrade code.
(build_ship, build_plane, build_land, supgr, pupgr, lupgr): Use them.
Upgrading planes no longer sets plane range to maximum.

(pupgr): Just clear the mission, don't bother to clear op area.

(doship, doplane, dounit): Editing tech now updates stats, like an
upgrade command.  Proper range checking.
(warn_deprecated): New.
(pr_ship, doship): Deprecate key 'D'.
(pr_land, dounit): Deprecate key 'A' and 'D'.
2004-05-16 14:19:38 +00:00
65ff91877f (move): Don't ask user whether he wants to abandon the sector when
running on behalf of the test command.  Closes #935470.
2004-05-16 11:40:14 +00:00
052c4d12ef (explore): Clear start sector's MOVE_IN_PROGRESS after updating end
sector.  Otherwise, clearing MOVE_IN_PROGRESS can abandon the start
sector when it shouldn't, leading to bogus records in the `lost' file.
Closes #931184.
2004-05-16 11:23:43 +00:00
d7e3eb9c97 (dship, dounit, doplane): No longer accept efficiency values that
would destroy the edited unit.  Deities can still delete a units by
setting the owner to zero.  Efficiency values less than 10 used to
delete the unit without informing the owner.  Ship efficiency values
between 10 and 20 did inform the owner, but didn't give him any clue
about the reason.
2004-05-15 15:06:07 +00:00
17494e74d1 (SCT_BLD_WORK, SHP_BLD_WORK, PLN_BLD_WORK, LND_BLD_WORK,
NUK_BLD_WORK): New, to encapsulate the formula in one place.

(SCT_MINEFF): New.  Use it instead of literal 20.

(buil): Use CANT_HAPPEN() for internal error.

(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower): Simplify avail calculation.

(lupgr, supgr, pupgr): Charge 15% of total build avail instead of an
undocumented amount computed from build lcm and hcm.

(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower, lupgr, supgr, pupgr): Fix reporting of required avail
when there's not enough.  Closes #942823.

(lupgr, supgr, pupgr): Code printed cost rounded down, but required
and charged unrounded cost.  Confusing.  Round cost down, like the
build command.  Closes #942811.

(UPGR_COST, UPGR_EFF, lupgr, supgr, pupgr): New UPGR_COST, UPGR_COST replace
literal values.

(show_bridge, show_tower): Don't claim bridge building requires
`workers' (whatever that is), since it doesn't.
2004-05-15 13:23:39 +00:00
3d5e881ae4 (eff_bomb, sect_damage): Damage avail just like efficiency. 2004-05-15 09:41:23 +00:00
6229a7a97a (do_feed): Rev. 1.4 accidentally limited avail after rollover to 999,
even when option ROLLOVER_AVAIL was off.  Previous revision correctly
limits rollover to rollover_avail_max, but missed the limiting after
rollover.  Fix.
2004-05-14 20:21:46 +00:00
0e7211738f (prod): Change variable work from double to int. This matches actual
production code better, and fixes a small inaccuracy introduced in
rev. 1.10.

(prod): Production is limited to 999 units.  Fix for production
efficiency > 1, e.g. agribusiness.

(prod): Raw material consumption was incorrectly limited to 999.

(prod): Production backlog was handled incorrectly; it claimed `will
make' lots, `max' less, which is backwards.
2004-05-14 19:53:17 +00:00