]> git.pond.sub.org Git - empserver/log
empserver
17 years agoAbstract from update trigger mechanism:
Markus Armbruster [Fri, 19 Jan 2007 06:46:10 +0000 (06:46 +0000)]
Abstract from update trigger mechanism:
(update_trigger): New.
(force, zdon): Use it.
(update_sem, update_force): Internal linkage.

(update_trigger, update_force): Passing a pointer to static storage as
thread argument is racy.  Use dynamic allocation.

17 years agoClean up includes after the previous revision.
Markus Armbruster [Fri, 19 Jan 2007 06:34:45 +0000 (06:34 +0000)]
Clean up includes after the previous revision.

17 years ago(struct loc_Thread, empth_sem_wait, empth_sem_signal) [WIN32]:
Ron Koenderink [Thu, 18 Jan 2007 14:28:23 +0000 (14:28 +0000)]
(struct loc_Thread, empth_sem_wait, empth_sem_signal) [WIN32]:
Remove the semaphore mutex and replace with hThreadMutex instead

17 years ago(struct loc_RWLock_t): Rename struct loc_RWLock_t to struct loc_RWLock
Ron Koenderink [Thu, 18 Jan 2007 01:22:32 +0000 (01:22 +0000)]
(struct loc_RWLock_t): Rename struct loc_RWLock_t to struct loc_RWLock
as the struct loc_RWLock_t is not a typedef.  No functional changes.

17 years ago(struct loc_Sem_t): Rename struct loc_Sem_t to struct loc_Sem
Ron Koenderink [Thu, 18 Jan 2007 01:18:19 +0000 (01:18 +0000)]
(struct loc_Sem_t): Rename struct loc_Sem_t to struct loc_Sem
as the struct loc_Sem_t is not a typedef.  No functional changes.

17 years ago(struct loc_Thread_t): Rename struct loc_Thread_t to struct loc_Thread
Ron Koenderink [Thu, 18 Jan 2007 01:12:43 +0000 (01:12 +0000)]
(struct loc_Thread_t): Rename struct loc_Thread_t to struct loc_Thread
as the struct loc_Thread_t is not a typedef.  No functional changes.

17 years ago(empth_wait_for_signal) [WIN32]: Simplify empth_wait_for_signal()
Ron Koenderink [Thu, 18 Jan 2007 01:05:19 +0000 (01:05 +0000)]
(empth_wait_for_signal) [WIN32]: Simplify empth_wait_for_signal()
by combined the waiting for hShutdownEvent and hThreadMutex
using the optional parmeter added to loc_RunThisThread().

17 years agoRemove the wait command, it's been broken and restricted to deity
Markus Armbruster [Wed, 17 Jan 2007 20:04:03 +0000 (20:04 +0000)]
Remove the wait command, it's been broken and restricted to deity
since Empire 2, ca. 1995:
(wai): Remove.
(player_coms): Update accordingly.

17 years ago(ac_encounter): Called writemap() only for active sorties, and not
Markus Armbruster [Wed, 17 Jan 2007 19:52:12 +0000 (19:52 +0000)]
(ac_encounter): Called writemap() only for active sorties, and not
when update_pending.  This makes no sense.  The map is updated in
memory and not calling writemap() only delays the write back to disk.
Remove the conditional.

17 years ago(can_listen): Never returns; change return type to void.
Markus Armbruster [Wed, 17 Jan 2007 19:22:49 +0000 (19:22 +0000)]
(can_listen): Never returns; change return type to void.

17 years ago(recvclient): Fix race condition: when io_output_all() blocked, then
Markus Armbruster [Wed, 17 Jan 2007 19:13:53 +0000 (19:13 +0000)]
(recvclient): Fix race condition: when io_output_all() blocked, then
got unblocked by command abortion, it could then block in io_input().

17 years ago(check_all_markets): Don't flush tables to disk. Remaining code is
Markus Armbruster [Tue, 16 Jan 2007 20:50:31 +0000 (20:50 +0000)]
(check_all_markets): Don't flush tables to disk.  Remaining code is
trivial; inline function into its only caller and remove it.

17 years agoFuse market update and market check thread:
Markus Armbruster [Tue, 16 Jan 2007 20:46:32 +0000 (20:46 +0000)]
Fuse market update and market check thread:
(check_all_markets): No longer a thread entry point.  Remove the
parameter.  Remove *player setup.  Don't terminate the thread when
done.
(market_update): Call check_all_markets() instead of running it in its
own thread.  Set up *player for it.
(market_init): Create the fused update thread instead of the update
wait thread.

17 years ago(market_init): New.
Markus Armbruster [Tue, 16 Jan 2007 20:22:06 +0000 (20:22 +0000)]
(market_init): New.
(start_server): Call it.  Move initialization stuff to it, with error
checking added.
(market_update): Internal linkage.

17 years agoFuse update wait thread and update thread:
Markus Armbruster [Tue, 16 Jan 2007 20:06:27 +0000 (20:06 +0000)]
Fuse update wait thread and update thread:
(update_main): No longer a thread entry point.  Remove the parameter.
Remove *player setup.  Don't terminate the thread when done.
(update_pending): Move to src/server/update.c.
(update_wait): Call update_main() instead of running it in its own
thread.  Set up *player for it.
(update_init): Create the fused update thread instead of the update
wait thread.

17 years agoFix the previous revision.
Markus Armbruster [Tue, 16 Jan 2007 19:54:12 +0000 (19:54 +0000)]
Fix the previous revision.

17 years ago(exit_nomem): New.
Markus Armbruster [Tue, 16 Jan 2007 19:26:31 +0000 (19:26 +0000)]
(exit_nomem): New.

(update_init): New.
(start_server): Call it.
(start_server, update_sched): Move initialization stuff to it, with
error checking added.
(update_sched): Internal linkage.

17 years agoSynchronize commands and update properly with a lock (towards
Markus Armbruster [Mon, 15 Jan 2007 19:57:26 +0000 (19:57 +0000)]
Synchronize commands and update properly with a lock (towards
resolving #1458175 and #1504036):
(update_lock): New.
(update_shed): Initialize it.
(update_wait, dispatch): Take exclusive update_lock around the update,
shared update_lock around commands.  This makes the update block until
all aborted commands terminated and gave up their lock.  Remove the
cheesy and unsafe two second wait for commands to finish.  It also
makes player threads block before executing commands while the update
is pending, removing the need to fail commands then.  So don't.

17 years ago(struct loc_Thread_t, struct loc_Sem_t, hThreadStartEvent)
Ron Koenderink [Mon, 15 Jan 2007 13:34:33 +0000 (13:34 +0000)]
(struct loc_Thread_t, struct loc_Sem_t, hThreadStartEvent)
(loc_RunThisThread, empth_init, empth_create, empth_wait_for_signal)
[EMPTH_W32]: Remove some incorrect references to semaphones
in the comments.  No functional changes.

17 years ago(loc_RunThread, empth_init, empth_threadMain, empth_yield)
Ron Koenderink [Mon, 15 Jan 2007 12:45:35 +0000 (12:45 +0000)]
(loc_RunThread, empth_init, empth_threadMain, empth_yield)
(empth_select, empth_sleep, empth_wait_for_signal)
(empth_sem_wait) [EMPTH_W32]: Add the ability to wait additional
event in loc_RunThread() when acquiring the hThread mutex.

(empth_rwlock_t, empth_rwlock_create, empth_rwlock_destroy)
(empth_rwlock_wrlock, empth_rwlock_rdlock, empth_rwlock_unlock): New.

(empth_rwlock_t, empth_rwlock_create, empth_rwlock_destroy)
(empth_rwlock_wrlock, empth_rwlock_rdlock, empth_rwlock_unlock)
[EMPTH_W32]: WIN32 implementation.

(empth_rwlock_t, empth_rwlock_create, empth_rwlock_destroy)
(empth_rwlock_wrlock, empth_rwlock_rdlock, empth_rwlock_unlock)
(lwp_rwlock, lwp_rwlock_create, lwp_rwlock_destroy)
(lwp_rwlock_wrlock, lwp_rwlock_rdlock, lwp_rwlock_unlock)
[EMPTH_LWP]: LWP implementation.

(empth_rwlock_t, empth_rwlock_create, empth_rwlock_destroy)
(empth_rwlock_wrlock, empth_rwlock_rdlock, empth_rwlock_unlock)
[EMPTH_POSIX]: pthread implementation.

17 years ago(produce_sect): Use bp_put_items() after calls that may update vec[].
Markus Armbruster [Sun, 14 Jan 2007 10:07:37 +0000 (10:07 +0000)]
(produce_sect): Use bp_put_items() after calls that may update vec[].
This is more robust than using bp_put_item() for those elements of
vec[] that the call may change.  The old code missed some changes:
upd_buildeff() changing population when tearing down a big city,
enlist(), and produce().  The first two should have been harmless, the
last one made budget mispredict repairs when required materials were
produced in the same update.

17 years ago(do_feed, produce_sect): Move bp_put_item() calls from do_feed() to
Markus Armbruster [Sun, 14 Jan 2007 10:03:19 +0000 (10:03 +0000)]
(do_feed, produce_sect): Move bp_put_item() calls from do_feed() to
produce_sect(), for consistency with the other update functions that
update sct_item[].  Parameter bp is now unused, remove.

17 years ago(do_feed): Don't update sp->sct_avail for growing of emergency ration,
Markus Armbruster [Sun, 14 Jan 2007 09:46:30 +0000 (09:46 +0000)]
(do_feed): Don't update sp->sct_avail for growing of emergency ration,
that's the caller's job.

17 years agoFix the previous revision.
Markus Armbruster [Sun, 14 Jan 2007 09:38:09 +0000 (09:38 +0000)]
Fix the previous revision.

17 years ago(bp_put_items): New.
Markus Armbruster [Sun, 14 Jan 2007 09:11:25 +0000 (09:11 +0000)]
(bp_put_items): New.
(bp_set_from_sect): Use it.

17 years ago(produce_sect): Don't truncate population; that's already done in
Markus Armbruster [Sun, 14 Jan 2007 08:59:07 +0000 (08:59 +0000)]
(produce_sect): Don't truncate population; that's already done in
do_feed().

17 years agoDocument.
Markus Armbruster [Sat, 13 Jan 2007 18:08:49 +0000 (18:08 +0000)]
Document.

(BP_CIVIL, BP_SHELL, BP_GUN): These were used write-only.  Remove.
(bud_key): Update accordingly.

(bp_item_idx): enumeration type for the bp_item[] indexes.  Use where
appropriate.

(bp_get_item): Oops on access to an item that is not tracked.

17 years ago(bp): Rename member val to bp_item, member avail to bp_avail. Users
Markus Armbruster [Sat, 13 Jan 2007 17:33:59 +0000 (17:33 +0000)]
(bp): Rename member val to bp_item, member avail to bp_avail.  Users
changed.  Switch from int to short, to match struct sctstr members
sct_item and sct_avail.

Symbolic indexes for struct bp member bp_item[]:
(BP_NONE, BP_CIVIL, BP_MILIT, BP_SHELL, BP_GUN, BP_LCM, BP_HCM)
(BP_MAX): New.
(bug_key): Use them.  Values are now array indexes, not indexes + 1.
(bp_get_item, bp_put_item, bp_set_from_sect): Update for changed
bud_key[].

17 years ago(alloc_bp, bp_alloc): Rename.
Markus Armbruster [Sat, 13 Jan 2007 17:11:17 +0000 (17:11 +0000)]
(alloc_bp, bp_alloc): Rename.
(fill_update_array, bp_set_from_sect): Rename.
(gt_bg_nmbr, pt_bg_nmbr, bp_get_item, bp_get_avail, bp_put_item,
bp_put_avail): Separate accessor functions for item and avail.

17 years ago(get_wp, bp_ref): Replace function returning pointer into a struct bp
Markus Armbruster [Sat, 13 Jan 2007 12:01:12 +0000 (12:01 +0000)]
(get_wp, bp_ref): Replace function returning pointer into a struct bp
by function returning to struct bp.  Leave member access to callers.
Callers changed.

17 years agoUpdate known contributors comment.
Markus Armbruster [Sat, 13 Jan 2007 10:16:43 +0000 (10:16 +0000)]
Update known contributors comment.

17 years agoReplace the revolting build pointer data structure by a proper data
Markus Armbruster [Sat, 13 Jan 2007 09:07:59 +0000 (09:07 +0000)]
Replace the revolting build pointer data structure by a proper data
type.  Make it abstract because that's possible.  Change data layout
so that the slots belonging to a sector are together in memory, it's
nicer to the cache.
(bp): The new type.  Users changed.
(get_wp): Update accordingly.
(alloc_bp): New.
(update_main, calc_all): Use it.  Before, calc_all() allocated 1/7
more than necessary.

17 years ago(get_materials): Redesign.
Markus Armbruster [Wed, 10 Jan 2007 07:15:45 +0000 (07:15 +0000)]
(get_materials): Redesign.
(shiprepair, planerepair, landrepair): Use it.  Behavioral change:
ship repairs outside harbors and plane repairs by a carrier can use
fewer materials.  Before, such repairs consumed each required
commodity as far as available.  Now, they consume the same fraction of
the real cost of each commodity, i.e. commodity use is limited by the
most scarce commodity.  Neither old nor new behavior make much sense,
but the new code is simpler.

17 years agoUpdate copyright notice.
Markus Armbruster [Tue, 9 Jan 2007 19:09:31 +0000 (19:09 +0000)]
Update copyright notice.

17 years agoBump version to 4.3.10.
Markus Armbruster [Mon, 8 Jan 2007 18:26:24 +0000 (18:26 +0000)]
Bump version to 4.3.10.

17 years agoUpdate for 4.3.9. v4.3.9
Markus Armbruster [Sat, 6 Jan 2007 12:46:01 +0000 (12:46 +0000)]
Update for 4.3.9.

17 years ago(marc, navi): Switch the parsing logic to facilitate the merging marc()
Ron Koenderink [Sat, 6 Jan 2007 12:35:44 +0000 (12:35 +0000)]
(marc, navi): Switch the parsing logic to facilitate the merging marc()
and navi() in the future.  No functional changes.

17 years ago(landrepair): Allow land unit repairs in allied sectors
Ron Koenderink [Thu, 4 Jan 2007 13:22:06 +0000 (13:22 +0000)]
(landrepair): Allow land unit repairs in allied sectors

17 years ago(decl): Prevent the deity from changing relations for a player to
Ron Koenderink [Wed, 3 Jan 2007 12:54:41 +0000 (12:54 +0000)]
(decl): Prevent the deity from changing relations for a player to
self.  Closes #1384998.  Allow the deity to set the relations of a
player towards the deity.

17 years ago(arm): Prevent a nuke from being on two planes at the same time.
Ron Koenderink [Tue, 2 Jan 2007 23:57:40 +0000 (23:57 +0000)]
(arm): Prevent a nuke from being on two planes at the same time.
Closes #1602998.

17 years ago(do_land_mob): Combine to two duplicate blocks of code.
Ron Koenderink [Tue, 2 Jan 2007 12:52:02 +0000 (12:52 +0000)]
(do_land_mob): Combine to two duplicate blocks of code.

17 years ago(march, navi): Switch to struct empobj * for leader and rename to leader.
Ron Koenderink [Tue, 2 Jan 2007 12:50:56 +0000 (12:50 +0000)]
(march, navi): Switch to struct empobj * for leader and rename to leader.
No functional changes.

17 years ago(setstr): Fix type error in variadic argument.
Markus Armbruster [Sun, 31 Dec 2006 17:21:11 +0000 (17:21 +0000)]
(setstr): Fix type error in variadic argument.

17 years ago(planerepair): Fix so only the player's own planes and allied planes
Ron Koenderink [Sun, 31 Dec 2006 17:19:46 +0000 (17:19 +0000)]
(planerepair): Fix so only the player's own planes and allied planes
are repaired.  Closes #757081.

17 years ago(shutdown_init): Has no effect, remove.
Markus Armbruster [Sun, 31 Dec 2006 17:05:57 +0000 (17:05 +0000)]
(shutdown_init): Has no effect, remove.

17 years agoNew option AUTO_POWER; closes #1009993:
Markus Armbruster [Sun, 31 Dec 2006 16:56:34 +0000 (16:56 +0000)]
New option AUTO_POWER; closes #1009993:
(opt_AUTO_POWER, update_power): New.
(update_main): Implement AUTO_POWER.
(powe): Disable power new when AUTO_POWER is on.

(powe): New power update.
(gen_power): Compute power into buffer passed by caller, make write to
power file optional.

17 years ago(genpower, powcmp): Sort struct powstr powbuf[] instead of struct
Markus Armbruster [Sun, 31 Dec 2006 13:38:46 +0000 (13:38 +0000)]
(genpower, powcmp): Sort struct powstr powbuf[] instead of struct
powsort order[].  Marginally less efficient, but simpler.
(powsort): Unused, remove.

17 years ago(update_main): Move logging of the update up to a more logical place.
Markus Armbruster [Sun, 31 Dec 2006 13:16:17 +0000 (13:16 +0000)]
(update_main): Move logging of the update up to a more logical place.

17 years ago(get_leader, pr_leader_change): New.
Ron Koenderink [Sun, 31 Dec 2006 12:31:18 +0000 (12:31 +0000)]
(get_leader, pr_leader_change): New.
(set_leader, set_flagship): Replace with get_leader() and
pr_leader_change().

17 years ago(planerepair) Remove the CANT_HAPPEN owner check
Ron Koenderink [Sat, 30 Dec 2006 21:05:36 +0000 (21:05 +0000)]
(planerepair) Remove the CANT_HAPPEN owner check
as allied planes and previously allied planes can
be on the ship.

17 years ago(do_mob_land): Fix to use all excess mobility for fortification, not
Ron Koenderink [Fri, 29 Dec 2006 19:56:00 +0000 (19:56 +0000)]
(do_mob_land): Fix to use all excess mobility for fortification, not
just up to the land unit's current mobility.

17 years ago(planerepair): Move the carrier sanity to before the carrier variable is
Ron Koenderink [Thu, 28 Dec 2006 17:44:03 +0000 (17:44 +0000)]
(planerepair): Move the carrier sanity to before the carrier variable is
used.

17 years ago(do_mob_land): Disable automatic land unit fortification with excess
Ron Koenderink [Tue, 26 Dec 2006 19:17:22 +0000 (19:17 +0000)]
(do_mob_land): Disable automatic land unit fortification with excess
mobility when MOB_ACCESS is on.  It leads to excessively deep
recursion and thus miserable performance as the number of land units
grows.

17 years ago(produce): Randomly flushed level production below 1.0 to zero. Fix.
Ron Koenderink [Tue, 26 Dec 2006 19:15:41 +0000 (19:15 +0000)]
(produce): Randomly flushed level production below 1.0 to zero.  Fix.

(produce): Assign rounded level production to *ACTUAL instead of
randomly rounded one.

17 years agoInclude pthread.h in the implementation instead of the header.
Markus Armbruster [Tue, 26 Dec 2006 16:52:11 +0000 (16:52 +0000)]
Include pthread.h in the implementation instead of the header.

17 years ago(ef_open) [_WIN32]: Fix to get a read lock instead of a write lock for
Ron Koenderink [Wed, 29 Nov 2006 12:16:43 +0000 (12:16 +0000)]
(ef_open) [_WIN32]: Fix to get a read lock instead of a write lock for
EFF_RDONLY and to get a write lock instead of a total file lock for
file opened for writing.

17 years agoFix rev. 1.24, which failed to charge mobility for sweeping without
Markus Armbruster [Tue, 21 Nov 2006 22:26:30 +0000 (22:26 +0000)]
Fix rev. 1.24, which failed to charge mobility for sweeping without
moving.

17 years agoBump version to 4.3.9.
Markus Armbruster [Sat, 21 Oct 2006 06:49:04 +0000 (06:49 +0000)]
Bump version to 4.3.9.

17 years ago4.3.8 last minute changes. v4.3.8
Markus Armbruster [Fri, 20 Oct 2006 18:33:29 +0000 (18:33 +0000)]
4.3.8 last minute changes.

17 years ago(upd_ship): Don't produce stuff when broke, to match sector behavior.
Markus Armbruster [Fri, 20 Oct 2006 18:30:26 +0000 (18:30 +0000)]
(upd_ship): Don't produce stuff when broke, to match sector behavior.

17 years agoUpdate for 4.3.8.
Markus Armbruster [Fri, 13 Oct 2006 18:29:22 +0000 (18:29 +0000)]
Update for 4.3.8.

17 years ago(switch_leader): Generalize the code, no functional changes.
Ron Koenderink [Tue, 10 Oct 2006 20:23:19 +0000 (20:23 +0000)]
(switch_leader): Generalize the code, no functional changes.
(navi): Change switch_flagship() to call switch_leader() instead.
(switch_flagship): Remove, not needed, replaced with switch_leader().

17 years ago(take_casualties): Code for distributing casualties among units did
Markus Armbruster [Sun, 8 Oct 2006 09:32:49 +0000 (09:32 +0000)]
(take_casualties): Code for distributing casualties among units did
not make sense, and in its confusion destroyed land land units when it
shouldn't.  Minimally invasive fix; code is still ugly and
incomprehensible.

17 years ago(guerrilla): Make security units not raid friendly che.
Markus Armbruster [Sun, 8 Oct 2006 09:21:26 +0000 (09:21 +0000)]
(guerrilla): Make security units not raid friendly che.

17 years ago(struct ulist): Add abstract reference to types.h to accomodate
Ron Koenderink [Wed, 4 Oct 2006 01:20:29 +0000 (01:20 +0000)]
(struct ulist): Add abstract reference to types.h to accomodate
the ciruclar reference between struct ulist and union empobj_storage
and struct lndstr.

17 years agoCombined struct llist and struct mlist into superset struct ulist.
Ron Koenderink [Mon, 25 Sep 2006 03:29:06 +0000 (03:29 +0000)]
Combined struct llist and struct mlist into superset struct ulist.
(assa, set_leader, switch_leader, set_flagship, switch_flagship,
take_move_in_mob, get_land, ask_olist, att_get_defense,
get_dlist, get_ototal, get_dtotal, kill_land, att_infect_units,
put_land, att_reacting_units, count_bodies, att_fight,
send_reacting_units_home, take_def, ask_move_in, move_in_land,
lnd_print, lnd_delete, lnd_take_casualty, lnd_takemob,
lnd_sel, lnd_mar, lnd_put, lnd_sweep, contains_engineer,
lnd_check_mines, lnd_list, lnd_mess,
lnd_damage, lnd_easiest_target, lnd_mar_one_sector, shp_sel,
shp_nav, shp_put, shp_sweep, shp_check_one_mines, shp_check_mines,
shp_list, shp_mess, shp_count, shp_damage_one, shp_damage,
shp_contains, most_valuable_ship, shp_easiest_target,
shp_missile_interdiction, notify_coastguard,
shp_view, shp_nav_one_sector, shp_missdef, nav_ship,
fltp_to_list): Switch to struct ulist from either struct mlist
or struct llist.

17 years ago(out5): Rev. 1.36. didn't fully fix the format conditional.
Markus Armbruster [Sat, 23 Sep 2006 15:47:40 +0000 (15:47 +0000)]
(out5): Rev. 1.36. didn't fully fix the format conditional.
Fold negative cases into positive ones.

17 years ago(apro) [!_WIN32]: Silently ignore directory entries starting with '.'.
Markus Armbruster [Sat, 23 Sep 2006 15:00:01 +0000 (15:00 +0000)]
(apro) [!_WIN32]: Silently ignore directory entries starting with '.'.
Before, apro() logged complaints about . and .. not being regular
files.

17 years agoClean up the previous revision.
Markus Armbruster [Sat, 23 Sep 2006 13:25:46 +0000 (13:25 +0000)]
Clean up the previous revision.

17 years agoDocument stop order expiry.
Markus Armbruster [Sat, 23 Sep 2006 13:24:19 +0000 (13:24 +0000)]
Document stop order expiry.

17 years ago(produce_sect): Game state changes may be changed only if
Markus Armbruster [Sat, 23 Sep 2006 10:47:58 +0000 (10:47 +0000)]
(produce_sect): Game state changes may be changed only if
player->simulation.  Fix a missing guard.  Existing callers should not
need it.

17 years ago(produce_sect, finish_sects): Move stop order expiry to end of update,
Markus Armbruster [Sat, 23 Sep 2006 10:37:55 +0000 (10:37 +0000)]
(produce_sect, finish_sects): Move stop order expiry to end of update,
so that stopped sectors don't repair units.  The update sequence
masked this bug until its change in src/lib/update/main.c rev. 1.25,
but use of budget priorities (gone since rev. 1.24) could unmask it.

17 years ago(sect_has_dock): NAV_CANAL in sect.h rev. 1.36 broke loading in
Markus Armbruster [Sat, 23 Sep 2006 09:09:43 +0000 (09:09 +0000)]
(sect_has_dock): NAV_CANAL in sect.h rev. 1.36 broke loading in
canals, fix.  Can't enforce M_CANAL condition here, so leave it to
callers.  Callers don't enforce it either, which means landlocked
ships can load in canals.  Oh well.

17 years ago(player_main): Delay journal_login() until after error exits, to
Markus Armbruster [Sat, 23 Sep 2006 08:58:54 +0000 (08:58 +0000)]
(player_main): Delay journal_login() until after error exits, to
ensure it is properly paired with journal_logout().

17 years ago(tend_land): Fix to not let land units be tended that could not be
Markus Armbruster [Sat, 23 Sep 2006 08:40:40 +0000 (08:40 +0000)]
(tend_land): Fix to not let land units be tended that could not be
loaded.

17 years agoRemove bogus paragraphs on RES_POP and NO_PLAGUE. Clarify sentence on
Markus Armbruster [Sat, 23 Sep 2006 08:37:57 +0000 (08:37 +0000)]
Remove bogus paragraphs on RES_POP and NO_PLAGUE.  Clarify sentence on
max safe population.

17 years agoUpdate for maximum population change in sect.config rev. 1.3. Remove
Markus Armbruster [Sat, 23 Sep 2006 08:35:36 +0000 (08:35 +0000)]
Update for maximum population change in sect.config rev. 1.3.  Remove
incorrect claims about mil.

17 years ago(genlist): Switch thing to use struct empobj * instead of void *.
Ron Koenderink [Fri, 1 Sep 2006 23:22:45 +0000 (23:22 +0000)]
(genlist): Switch thing to use struct empobj * instead of void *.
Remove type from struct genlist as it can be determined from thing.
Users changed.

17 years ago(struct trdstr): Change trd_type to be short to be consistent with the
Ron Koenderink [Tue, 22 Aug 2006 03:52:44 +0000 (03:52 +0000)]
(struct trdstr): Change trd_type to be short  to be consistent with the
rest of the definitions of ef_type.

17 years ago(empobj_chr): New, create a new (imcomplete) structure for
Ron Koenderink [Fri, 18 Aug 2006 23:32:45 +0000 (23:32 +0000)]
(empobj_chr): New, create a new (imcomplete) structure for
empobj characteristics.
(get_empobj_chr):  Update get_empobj_chr() to use new
struct empobj_chr.

17 years ago(radar): New, moved functionality from rada() except ef_type determination.
Ron Koenderink [Wed, 16 Aug 2006 01:16:30 +0000 (01:16 +0000)]
(radar): New, moved functionality from rada() except ef_type determination.
(rada): Call radar() with EF_SHIP.
(lrad): New, call radar() with EF_LAND.
(empmod[]): Call lrad() for lradar command.
(march, navi): Call radar() with appropriate type.

17 years ago(EF_IS_VIEW): New.
Markus Armbruster [Sun, 13 Aug 2006 07:29:30 +0000 (07:29 +0000)]
(EF_IS_VIEW): New.
(xdump): Use it to deny access to views when denying access to game
state.  Fixes the previous revision.

17 years ago(obj_nameof): Return safer error value.
Markus Armbruster [Sun, 13 Aug 2006 07:18:11 +0000 (07:18 +0000)]
(obj_nameof): Return safer error value.

(get_empobjp, get_empobj_chr, emp_obj_chr_name, get_empobj_mob_max):
Style.

17 years agoAllow xdump before break; partial solution for #1417871:
Markus Armbruster [Sun, 13 Aug 2006 07:13:37 +0000 (07:13 +0000)]
Allow xdump before break; partial solution for #1417871:
(player_coms): Set xdump's c_permit to VIS.
(xdump): Deny countries that couldn't run xdump before access to game
state.

17 years ago(ef_open) [_WIN32]: Add shared.h for MinGW environment,
Ron Koenderink [Tue, 8 Aug 2006 22:43:18 +0000 (22:43 +0000)]
(ef_open) [_WIN32]: Add shared.h for MinGW environment,
needed for WIN32 file locking. Broken (missed) in rev 1.70.

17 years ago(ef_open) [_WIN32]: Provide file locking for WIN32.
Ron Koenderink [Mon, 7 Aug 2006 17:15:04 +0000 (17:15 +0000)]
(ef_open) [_WIN32]: Provide file locking for WIN32.

17 years ago(rada): Replace the "unit" text with "land" to be more clear.
Ron Koenderink [Fri, 4 Aug 2006 19:59:24 +0000 (19:59 +0000)]
(rada): Replace the "unit" text with "land" to be more clear.

17 years ago(rada): Using struct empobj to generalize the code.
Ron Koenderink [Wed, 2 Aug 2006 22:07:12 +0000 (22:07 +0000)]
(rada): Using struct empobj to generalize the code.

17 years ago(makelost, makenotlost, findlost, struct loststr): Change type to be a
Ron Koenderink [Wed, 2 Aug 2006 21:46:34 +0000 (21:46 +0000)]
(makelost, makenotlost, findlost, struct loststr): Change type to be a
short instead of a char.  This will make lost_type consistent with
ef_type in the rest of the structures.

17 years ago(unit_map): Replace player->owner with direct owner check and
Ron Koenderink [Wed, 2 Aug 2006 18:39:22 +0000 (18:39 +0000)]
(unit_map): Replace player->owner with direct owner check and
player->god check.  player->owner is not set if ef_ptr() is used
as no post_read() is done. Broken in rev 1.38.  Not completely fixed
in rev 1.40.

17 years ago(ef_open): Lock the file. This prevents two programs (servers in
Markus Armbruster [Wed, 2 Aug 2006 18:05:04 +0000 (18:05 +0000)]
(ef_open): Lock the file.  This prevents two programs (servers in
particular) running on the same game state.  fairland does not use
ef_open() at this time, and thus ignores the lock.

17 years ago(produce): The reported amount produced (returned through last
Markus Armbruster [Wed, 2 Aug 2006 17:58:20 +0000 (17:58 +0000)]
(produce): The reported amount produced (returned through last
parameter) did not reflect production cut for ITEM_MAX.  Broken in
3.0.14 or so.  Reported by Stefan Hauser.

17 years ago(gift): Remove the type argument, can be determined from the ptr
Ron Koenderink [Wed, 2 Aug 2006 13:07:09 +0000 (13:07 +0000)]
(gift): Remove the type argument, can be determined from the ptr
argument. Replace prship/prland/prplane/prnuke code with
obj_nameof().

17 years ago(unit_map): Replace player->owner with direct owner check.
Ron Koenderink [Sun, 30 Jul 2006 01:05:17 +0000 (01:05 +0000)]
(unit_map): Replace player->owner with direct owner check.
player->owner if not set if ef_ptr() is used as no post_read() is done.
Broken in rev 1.38.

17 years ago(getpath): Remove check for DIR_MAP.
Ron Koenderink [Sat, 29 Jul 2006 17:55:22 +0000 (17:55 +0000)]
(getpath): Remove check for DIR_MAP.
DIR_MAP is not a value that can be entered by the user.

17 years ago(draw_map): Use struct empobj to generalize the code.
Ron Koenderink [Thu, 27 Jul 2006 23:32:55 +0000 (23:32 +0000)]
(draw_map): Use struct empobj to generalize the code.

17 years ago(map): Prompt only for sects for map and bmap commands.
Ron Koenderink [Wed, 26 Jul 2006 23:13:52 +0000 (23:13 +0000)]
(map): Prompt only for sects for map and bmap commands.
Broken in 1.27.

17 years ago(get_empobj_chr, obj_nameof): Switch CANT_HAPPEN() to
Ron Koenderink [Wed, 26 Jul 2006 01:09:11 +0000 (01:09 +0000)]
(get_empobj_chr, obj_nameof): Switch CANT_HAPPEN() to
CANT_REACH().

(get_empobj_mob_max): Remove carriage return.

17 years ago(get_empobj_mob_max): Move the return -1 to the end of function.
Ron Koenderink [Wed, 26 Jul 2006 01:01:14 +0000 (01:01 +0000)]
(get_empobj_mob_max): Move the return -1 to the end of function.

17 years ago(emp_obj_chr_name): Move the return NULL to the end of function.
Ron Koenderink [Wed, 26 Jul 2006 00:58:14 +0000 (00:58 +0000)]
(emp_obj_chr_name): Move the return NULL to the end of function.