2004-05-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve file path handling on the Unix platform.
	* unix.c (is_directory): New function. Tests if a given path 
	corresponds to a directory type filesystem entity.
	  (default_library_pathname): Do not simply return the value 
	from the environment or the compiled in one. Check to see if 
	the specified directory actually exists, and, if not, start 
	checking to see if the Xconq game library can be found in any 
	number of fairly standard locations.
	  (default_images_pathname): Likewise, but for the images 
	library.
	  (score_file_pathname): Likewise, but for the scorefiles location. 
	Also, attempt to create the scores directory if it does not exist.

	Improve the building of a dist tarball.
	* Makefile.in (DISTNAME): Change from date to version.
	  (dist): Wipe out any old tarballs. Automatically 
	use gzip compression. Insert 'DISTNAME' directory before all 
	file paths in the archive.

	Update and improve RPM spec file for Tcl/Tk interface.
	* tcltk/xconq.spec (Source0): Reflect the new name of the 
	dist tarball.

2004-05-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve handling of a changed unit's actor state.
	* actions.c (do_change_type_action): Make sure that ACP is only 
	deducted for units which have ACP and that it is deducted only down 
	to the minimum ACP the unit can have.
	* unit.h (type_acp_max): New macro. Determine the maximum ACP for a 
	unit type.
	* unit.c (change_unit_type): Carefully handle the various cases 
	that can occur when one unit is changing into another. Scale ACP 
	between old and new unit when both have ACP; make sure that new 
	unit does not have ACP if it cannot have or use ACP; give new unit 
	ACP a full serving of fresh ACP if it was formerly an unit type 
	which could not have or use ACP. Also, set the next action to 
	'ACTION_NONE' because it might be illegal with the new unit.

	Provide location for tests which have not been automated, and supply 
	the first unautomated test to it.
	* test/manual: New directory.
	* test/manual/change-type-acp-test.g: Make sure that the  
	actor state is set up correctly when a 'change-type' action 
	occurs. Permute through the various cases.

2004-05-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Restructure the Xconq main downloads Web page to more accurately 
	reflect the contents of the 'Unix' directory tree. Also add 
	HTML anchors to the various download sections by platform.
	* [htdocs]/ftp.html

2004-05-22  Hans Ronne <hronne@comhem.se>

	Update the Xconq web site with links to the 7.5 pre-release 
	packages for the Xconq Curses and SDL apps on the ftp site.
	* htdocs/ftp.html: Add links to the Curses and SDL apps.

2004-05-21  Hans Ronne <hronne@comhem.se>

	Make the curses interface build natively under Windows
	using curses.lib from the pdcurses 2.5 library.
	* cconq.c (MAC): Don't define it ifdef __MWERKS__
	(EXPORT): Define it ifdef WIN32 && ifndef __CYGWIN32__
	(COLS): Initialize to 0 ifdef WIN32 && ifndef __CYGWIN32__
	(LINES): Initialize to 0 ifdef WIN32 && ifndef __CYGWIN32__
	(stdscr): Declare ifdef WIN32 && ifndef __CYGWIN32__
	(main): Only set SIOUXSettings ifdef __MWERKS__ && ifdef MAC.
	(init_display): Set LINES to 24 and COLS to 80 and call newwin
	to get stdscr ifdef WIN32 && ifndef __CYGWIN32__
	* cdraw.c (draw_units): Remove unused int xw.
	* curses/Xconq.ico: Add Windows application icon file.
	* curses/Xcdoc.ico: Add Windows document icon file.
	* curses/Xconq.RC: Add Windows resource file.
	
	Don't assume that CodeWarrior always builds a Mac application.
	* libcurses/curses.h (MAC): Don't define it ifdef __MWERKS__
	(QD): Define it only ifdef MAC && ifdef __MWERKS__

	Fix compile problem in the Windows curses interface due 
	to the fullsized macro being passed a null pointer argument.
	* task.c (do_build_task): Test if view_unit(uview) exists
	before passing it to fullsized.

2004-05-21  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix crashing bug caused by damaged terrain attempting to convert 
        from a cell type to an auxiliary type. A cell type should always 
        be present in a cell. (Bug report and patch (with an addition 
        from me) from Matthew Skala.)
        * combat.c (damage_terrain): Downgrade an error to a warning and 
        make it more informative.
          (damaged_terrain_type): If the old terrain type was a cell type, 
        and the new one is not, then do not do anything.

2004-05-20  Hans Ronne <hronne@comhem.se>

	Update the Xconq web site with links to the 7.5 pre-release 
	packages on the ftp site.
	* htdocs/index.html: Update News and Links. Move old news 
	to older-news.
	* htdocs/older_news.html: Move old stuff here.
	* htdocs/ftp.html: Rewrite with 7.5 pre-release links.
	* htdocs/ftp-old.html: New page with 7.4 ftp links.

	Update the html manual from the texi sources.
	* htdocs/manual/*.html: Update all pages.
	
2004-05-20  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix serious flaw in the evaluation of the fire task. (Thanks to 
	Elijah Meeks for the bug report.)
	* task.c (fire_can_damage): Do not look at the 'uu_hit' and 
	'uu_damage' tables directly; instead, call 'fire_hit_chance' and 
	'fire_damage' respectively. Also, fix misplaced right parentheses 
	in the occupants loop, so that utypes other than 0 or 1 (booleans) 
	get compared with.
	  (fire_can_damage_or_capture): Rewrite in terms of 
	'fire_can_damage'; with the exception of the capture test and one 
	comment, the code was an exact duplicate of 'fire_can_damage'.

2004-05-20  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve top-level makefile template.
	* Makefile.in (html, clean-dvi, clean-html): Enable in the 
	top-level.
	  (dist): Build HTML docs in addition to the TexInfo docs. Also 
	filter out more developer-related directories when building a 
	tar file. (Note: Still need to think about prepending a path, 
	such as 'xconq' or 'xconq-$date' to the files in the archive.)

	Improve RPM spec file for the Tcl/Tk interface.
	* tcltk/xconq.spec (name, version, prereleaselvl, releaselvl, 
	releasedate, release): New user-defined macros for greater 
	flexibility.
	  (release): Compute macro from 'prereleaselvl', 'releaselvl', 
	'releasedate', and 'releaselvl' macros as appropriate. Please see 
	spec file's internal documentation for details.
	  (Name): Use '%{name}'.
	  (Epoch): Set to '1' to override older Xconq RPM's with different 
	versioning schemes that would cause RPM version logic to fail.
	  (Version): Use '%{version}'.
	  (Release): Use '%{release}'.
	  (Copyright): Delete field.
	  (License): New field, Assign value: "GPL".
	  (Source0): Determine based on '%{releasedate}'.
	  (buildroot): New user-defined macro which helps enable 
	the creation of Xconq RPM's as a regular user in a specified 
	directory hierarchy.
	  (BuildRoot): Use '%{buildroot}'.
	  (%build): Make the invocation of 'configure' use paths relative 
	to '%{buildroot}'. (Note: This creates issues with Xconq once its 
	binaries are installed in their intended locations. This should 
	be resolved in the Xconq filepath code pieces by falling back on 
	good guesses for the lib dir, if it cannot be found relative to 
	the '%{buildroot}/usr/share' one. The compiled-in dir should still 
	be tried first in case a developer has multiple instances of Xconq 
	installed on the system, but the fallbacks should also be present 
	to deal with the abovementioned RPM-related case and for general 
	robustness.)
	  (%install): Make sure that the Xconq scores directory is 
	properly created.
	  (%files): Add '%defattr(-,root,root,0755)' so that all installed 
	files will be owned by the 'root' group and user, have their 
	permissions left as Xconq's 'make install' set them, and set all 
	directories to be walked into by anyone. Add '%doc' directive for 
	'hacking.info' and wildcard the one for the 'xconq.6' man page. 
	The wildcard is needed if though there is only one item, because 
	some 'rpm-build' configurations will compress documentation and 
	others will not.
	  (%changelog): New section. Put in some initial fluff.

2004-05-20  Hans Ronne <hronne@comhem.se>

	Fix bug that prevented the designer save dialog in the tcltk
	interface from working correctly.
	* tkconq.tcl (save_design): Set dname to game_homedir and
	pass it as initialdir to tk_getSaveFile.

	Fix two bugs in handling of the prefixarg in the Mac interface.
	* maccmd.c (do_keyboard_command): Rewrite the decimal digit
	adding code so that it works correctly. Reset dside->prefixarg to
	(-1) after calling execute_command.

	Fix so that the Mac message dialog diMessageTo text edit field 
	works correctly.
	* maccmd.c (message_dialog): Get rid of nsidedesc. Add code that 
	sets sidedesc from diMessageTo. Set sidemask to ALLSIDES if 
	sidedesc is "all", else set sidemask to NOSIDES, pass sidedesc to 
	parse_side_spec and add the resulting side to sidemask.
	
	Fix bugs that caused popup menus to be much too wide under 
	Mac OSX 10.3. Thanks to Bob Beaty for reporting this bug.
	* Xconq.r (CNTL 240 "Plan Type Popup"): Tweak control size.
	(CNTL 700 "Preferences Popup"): Tweak control size.
	(CNTL 710 "Build Popup"): Tweak control size.
	(CNTL 711 "Science Popup"): Tweak control size.
	(CNTL 715 "City Build Popup"): Tweak control size.
	(DITL 700 "Preferences"): Tweak control size.
	(DITL 803 "Advanced Closeup"): Tweak control sizes.
	(DITL 804 "Unit Research"): Tweak control size.
	(DITL 807 "Unit Build"): Tweak control size.
	(DITL 808 "Unit Plan"): Tweak control size.
	
	Fix so that multiple rounds of building in the same turn is
	possible again for acp-independent units. Thanks to Matthew
	Skala for reporting this bug.
	* run.c (run_construction): Don't set the buildingdone flag
	for human-controlled units that completed a build task.

2004-05-17  Eric McDonald  <mcdonald@phy.cmich.edu>

	Changes to Bellum Aeternum. Details contained in 
	'lib/ChangeLog-bellum'.

2004-05-17  Eric McDonald  <mcdonald@phy.cmich.edu>

	More thoroughly fix the multiple move in direction bug 
	(original incomplete fix was yesterday).
	* task.c (do_move_dir_task): Rearrange code so that movement 
	is checked before entry into a unit. This allows a mover to 
	attempt entry into a cell that contains a trusted unit which 
	is not a transport for the mover but may be able to coexist 
	within the confines of the cell alongside the mover. If this 
	fails, then look for a possible trusted transport to enter.

2004-05-17  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix create/build bug that would prevent a unit which had 
	cancelled its plan (and thereby flushed its task agenda) from 
	building a new unit of a different type. (Reported by Tom 
	Low-Shang. Thanks for all the reports, Tom.) Also, slightly 
	restructure the code to make the various segments clearer and 
	remove a redundancy.
	* task.c (do_build_task): If an unit that is supposedly under 
	construction is alive (complete or incomplete), that is sufficient 
	for testing its completeness; its type does not need to be 
	matched to the utype indicated by the task. Indeed, the type 
	should not be matched, because the utype indicated by the task 
	may have changed, whether or not the unit under construction is 
	complete. Instead, the unit lookup should be flushed if the task utype 
	and the under-construction unit's type do not match. Also, if a 
	looked up unit is not type mismatched and is not complete, then do not 
	explicitly continue its build in the lookup code branch; fall through 
	to the bottom of the task handler, where building is done for any unit 
	under construction, whether it is found by the above lookup or by 
	searching for a unit to complete. Furthermore, explicitly ensure 
	that the search code is only being run if the lookup code fails to 
	find a designated unit under construction, or finds one but flushes it 
	for various reasons (including the one mentioned above).

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix display bug reported by Tom Low-Shang.
	* plan.c (set_waiting_for_tasks): Call 'update_unit_display' 
	and let it schedule a lazy (non-immediate) update. This has the 
	effect of clearing out failed tasks that still linger on the 
	display sometimes; it is harmless to be called by the AI. (Note: 
	The UI still needs to try and predict as many task failures as 
	possible, so that the user gets proper feedback. For example, 
	the multiple move direction command should check to see if the 
	very first cell in the given direction from the present position 
	blocks the attempted move, and warn the user if so.) 

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in return for resupply. Reported by Tom Low-Shang.
	* task.c (do_move_to_task): If a resupply is going to be 
	performed because an unspecified supply or multiple supplies 
	are missing, then only cancel the move/resupply combination if 
	all supplies have been replenished in this case.

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in multiple movement in a straight line direction so that 
	it is not impeded by friendly transports that can contain the 
	mover. Bug reported by Tom Low-Shang and confirmed by Jim. Also 
	improve the task code to use unit views instead of raw units so 
	that it cannot be used to cheat (e.g., stopping for unseen enemy 
	units).
	* task.c (do_move_dir_task): Rewrite the entry code to use unit 
	views. Also, scrutinize the failure return stati of 
	'check_enter_action' more closely. In some cases, the mover may 
	just need to rest and recover ACP before it can enter the transport.

2004-05-16  Jim Kingdon  <kingdon@panix.com>

	* kernel/autotest.c: Remove declaration of set_node_data; the code
	which called it was removed on 2 May 2004.

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug reported by Martin Fehlhaber and confirmed by Tom 
	Low-Shang. (Thanks guys. Also thanks to Tom for testing the 
	patch.) Bug caused Xconq to freeze when using a multithreaded 
	Tcl interpreter; presumably this occurred because the interpreter 
	maintained a thread to handle events and it was doing a blocking 
	wait on something, which was causing other event handling requests 
	to go unanswered.
	* tcltk/tkmain.c (ui_mainloop): Call 'Tcl_DoOneEvent' with the 
	'TCL_DONT_WAIT' flag set.
	* tcltk/tkmap.c (mapw_display): Likewise.

2004-05-14  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in construction code that caused a build task to attempt 
	a build on a completed unit, and count that as the create/build 
	of a new unit. This burned through extra construction run length.
	Bug reported by Ed Oskiewicz.
	* task.c (do_build_task): If a complete unit is found based on the 
	unit ID from the builder's 'creation_id' or from the task, reset 
	the 'unit2' unit lookup variable to NULL, so that a new unit 
	will be created, if we don't return with 'TASK_IS_COMPLETE' 
	because more create/build runs must still be executed.

	Fix total failures of reason and logic on my part in recent 
	wake behavior patch (2004/05/13).
	* plan.c (wake_unit): Back out ACP-less unit interception. They 
	can't act anyway, so why make much ado about nothing? Furthermore, 
	they may have occupants that should be forcefully awakened.
	  (selectively_wake_unit): Check only transport's immediate 
	occs, and their occs (if any) when determining whether they should 
	be awakened or not. If so, then recursively call 
	'selectively_wake_unit', thereby letting them determine whether to 
	pass along the wake to their own occs based on their relationships 
	with those occs. Disable this revised code until a valid test case 
	can be created for it.

2004-05-14  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add documentation on new 'uu_can_recursively_wake' table.
	* doc/refman.texi (can-recursively-wake): New entry in 
	"Occupants and Transports" section.

2004-05-13  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add patch from Matthew Skala (with modifications and additions 
	of my own). Give game designer control over recursive wakeup of 
	occs due to their transport spotting an enemy. Also, make any 
	assaulted unit immediately wake up.
	* table.def (uu_can_recursively_wake): New TableUU. Determines 
	whether transport should wake occ, if transport experiences 
	something that would make it wake.
	* kernel.h (wake_unit): Change argument name from 'wakeoccs' to 
	'forcewakeoccs'.
	  (selectively_wake_unit): New prototype.
	* plan.c (wake_unit): Add assert to make sure that a valid 
	unit was passed to the function. Add check to see if an attempt 
	to wake an ACP-less unit is being made, and simply return if so. 
	Change argument name from 'wakeocc' to 'forcewakeoccs'.
	  (selectively_wake_unit): New function. Calls 'wake_unit' based 
	on whether the occupant/transport allows the wakeup.
	* combat.c (hit_unit): Call 'wake_unit' on the assaulted unit if 
	it is still alive.
	* side.c (react_to_seen_unit): Call 'selectively_wake_unit' if 
	an enemy is spotted. Due not force occs to wake, but let the 
	'uu_can_recursively_wake' table decide for the time being. (In the 
	longer term, we may want to couple this logic with a 
	'wake-upon-enemy-seen' table or somesuch.) Add comment that the 
	'g_see_all()' branch in this function does not appear to get 
	executed in see-all games, because the coverage functions are 
	not called; this should be investigated further and fixed if 
	necessary.

2004-05-11  Eric McDonald  <mcdonald@phy.cmich.edu>

	Convert all 'char' and 'unsigned char' bitmap array types to 
	'BMAP_BYTE'.
	* ui.h (BMAP_BYTE): New macro. Determine type based on whether 
	we are using C or C++.
	* x11/xshowimf.c (BMAP_BYTE): Duplicate of previous macro, since 
	'xshowimf' does not use 'ui.h'.
	* addunits.b: Use 'BMAP_BYTE' macro.
	* ants.b: Likewise.
	* attackcurs.b: Likewise.
	* attackmask.b: Likewise.
	* bomb1.b: Likewise.
	* bomb2.b: Likewise.
	* bomb3.b: Likewise.
	* bomb4.b: Likewise.
	* bord32-1.b: Likewise.
	* bordcurs.b: Likewise.
	* buildcurs.b: Likewise.
	* buildmask.b: Likewise.
	* check.b: Likewise.
	* closer.b: Likewise.
	* conncurs.b: Likewise.
	* cursbord.b: Likewise.
	* cursbordm.b: Likewise.
	* curscell.b: Likewise.
	* curscellm.b: Likewise.
	* cursclouds.b: Likewise.
	* curscloudsm.b: Likewise.
	* curscoat.b: Likewise.
	* curscoatm.b: Likewise.
	* cursconn.b: Likewise.
	* cursconnm.b: Likewise.
	* curselev.b: Likewise.
	* curselevm.b: Likewise.
	* cursfeat.b: Likewise.
	* cursfeatm.b: Likewise.
	* cursmaterial.b: Likewise.
	* cursmaterialm.b: Likewise.
	* curspeop.b: Likewise.
	* curspeopm.b: Likewise.
	* curstemp.b: Likewise.
	* curstempm.b: Likewise.
	* cursunit.b: Likewise.
	* cursunitm.b: Likewise.
	* cursview.b: Likewise.
	* cursviewm.b: Likewise.
	* curswinds.b: Likewise.
	* curswindsm.b: Likewise.
	* darkgray.b: Likewise.
	* delay.b: Likewise.
	* dots.b: Likewise.
	* farther.b: Likewise.
	* feature.b: Likewise.
	* featuremask.b: Likewise.
	* fuzz16.b: Likewise.
	* fuzz32.b: Likewise.
	* fuzz64.b: Likewise.
	* gray.b: Likewise.
	* hex16.b: Likewise.
	* hex16b.b: Likewise.
	* hex16iso.b: Likewise.
	* hex32.b: Likewise.
	* hex32b.b: Likewise.
	* hex32iso.b: Likewise.
	* hex64.b: Likewise.
	* hex64b.b: Likewise.
	* hex64iso.b: Likewise.
	* hex8.b: Likewise.
	* hex8b.b: Likewise.
	* hex8iso.b: Likewise.
	* hexcurs.b: Likewise.
	* hexcursmask.b: Likewise.
	* hit.b: Likewise.
	* iso.b: Likewise.
	* kill.b: Likewise.
	* laurels.b: Likewise.
	* lookglass.b: Likewise.
	* lookmask.b: Likewise.
	* miss.b: Likewise.
	* movecurs.b: Likewise.
	* movemask.b: Likewise.
	* people.b: Likewise.
	* reserve.b: Likewise.
	* return.b: Likewise.
	* rotl.b: Likewise.
	* rotr.b: Likewise.
	* scursdown.b: Likewise.
	* scursdownm.b: Likewise.
	* scursleft.b: Likewise.
	* scursleftm.b: Likewise.
	* scursright.b: Likewise.
	* scursrightm.b: Likewise.
	* scursup.b: Likewise.
	* scursupm.b: Likewise.
	* shootcurs.b: Likewise.
	* shootmask.b: Likewise.
	* sleep.b: Likewise.
	* wind0.b: Likewise.
	* wind1e.b: Likewise.
	* wind1ne.b: Likewise.
	* wind1nw.b: Likewise.
	* wind1se.b: Likewise.
	* wind1sw.b: Likewise.
	* wind1w.b: Likewise.
	* wind2e.b: Likewise.
	* wind2ne.b: Likewise.
	* wind2nw.b: Likewise.
	* wind2se.b: Likewise.
	* wind2sw.b: Likewise.
	* wind2w.b: Likewise.
	* wind3e.b: Likewise.
	* wind3ne.b: Likewise.
	* wind3nw.b: Likewise.
	* wind3se.b: Likewise.
	* wind3sw.b: Likewise.
	* wind3w.b: Likewise.
	* wind4e.b: Likewise.
	* wind4ne.b: Likewise.
	* wind4nw.b: Likewise.
	* wind4se.b: Likewise.
	* wind4sw.b: Likewise.
	* wind4w.b: Likewise.

	* configure: Regenerated with newer version of autoconf.

	Changes to Bellum Aeternum. Please see 'ChangeLog-bellum' for 
	details.

2004-05-10  Hans Ronne <hronne@comhem.se>

	Fix crashes due to accessing an unallocated area layer 
	when writing some saved games.
	* write.c (write_side_view): Comment out code that tries 
	to access the bogus side->auxterrviewdate layer.

2004-05-10  Hans Ronne <hronne@comhem.se>

	Fix intermittent failure of the tcltk Xconq to pop up the 
	splash screen when launched from Classic under Mac OSX.
	* tkmac.c (popup_game_dialog): Don't prototype here 
	since it is already prototyped in tkconq.h.
	(main): Call popup_game_dialog before ui_mainloop to make 
	sure the splash screen always is popped up. Add comment 
	about command line code not yet being enabled.

	Fix problem with the splash screen sometimes popping
	up twice due to the above fix.
	* tkconq.tcl (popup_splash_screen): Test if .newgame
	exists already here and just return if true.
	(create_newgame_window): Remove code that tests if
	.newgame already exists.

	Make map view option settings for individual maps persist
	when the tcltk preferences are changed. This makes the tcltk
	interface behave like the Mac interface and eliminates the
	annoying behaviour where view settings for individual maps 
	would revert to default values whenever the preferences
	dialog was used.
	* tkconq.tcl (set_options_from_prefs): Iterate over
	map_options instead of default_map_options.
	(create_map_menus): Change default_map_options to
	map_options everywhere. Pass $mapn in the call to
	popup_meridian_interval_dialog.
	(set_map_view_option): Change default_map_options to
	map_options.
	(popup_meridian_interval_dialog): Change 
	default_map_options to map_options.
	(ok_meridian_interval): Change default_map_options to 
	map_options.
	(ok_preferences): Don't set default_map_options. Remove
	code that was commented out on 2004-05-08.
	(make_people_paint_frame): Change default_map_options 
	to map_options.
	(make_control_paint_frame): Change default_map_options 
	to map_options.
	(make_elev_paint_frame): Change default_map_options 
	to map_options.
	
	Fix bug that would cause the "Feature Names" and "Feature
	Boundaries" tcltk menu items to be checked even if features 
	do not exist.
	* tkconq.tcl (adjust_view_menu): Set the feature_names
	and feature_boundaries items to 0 if numfeatures is 0.

	Fix so that the meridian interval dialog works correctly 
	also with several open maps.
	* tkconq.tcl (meridian_map_number): New global.
	(popup_meridian_interval_dialog): Don't withdraw it (or
	check if it already exists). Instead, always destroy and
	re-create it, so that $mapn is set correctly each time. 
	Set new_meridian_interval to $prefs(meridian:interval).
	Pass meridian_map_number to ok_meridian_interval.
	(ok_meridian_interval): Don't withdraw .meridian.
	Destroy it instead when done.

	Add the ability to set the default meridian interval from 
	the preferences dialog.
	* tkconq.tcl (ok_meridian_interval): Set newprefs to
	$new_meridian_interval when passed 0 as $mapn.
	(add_map_prefs_items): Add button for setting the
	meridian interval.

2004-05-09  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in the 'choose_move_direction' wrapper.
	* task.c (choose_move_direction): Use 
	'side_thinks_it_can_put_type_at' instead of 
	'type_can_occupy_cell' to prevent a unit from incorrectly 
	being hindered from moving by a friendly unit whose volume 
	completely occupies a cell on the path.

	Add comment about why another bug cannot be fixed so easily.
	* task.c (choose_move_direction)

2004-05-09  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix overzealous error reporting that was not compatible with 
	the random planner's random action generator.
	* actions.c (check_change_type_action): Disable asserting a 
	valid utype for the time being. Instead, simply return with an 
	error code.

2004-05-08  Hans Ronne <hronne@comhem.se>

	Fix so that the saved game directory is used by default for 
	the Open File command on all three tcltk platforms.
	* tkmain.c (tk_game_homedir): New TclCmdFn and prototype.
	(initial_ui_init): Define the game_homedir tcl command.
	* tkconq.tcl (popup_open_dialog): Use game_homedir to 
	set tk_getOpenFile -initialdir.
	 
	Fix bug that would cause XconqPrefs to be saved in the wrong
	place if the game file was opened from a non-standard location.
	* module.c (preferences_name): Remove static pointer.
	(preferences_filename): Don't use preferences_name to 
	cache the file name. Always recompute it instead.
	(old_preferences_filename): Ditto.
	* tkmain.c (get_preferences): Rewrite and simplify so that 
	loading of OLD_PREFERENCESFILE works on all platforms.
	Use fopen instead of stat to test if a given file exists.
	
	Get rid of another unused pointer in the module code.
	* module.c (save_name): Remove static pointer.

	 Get rid of bogus hidden name for the saved game 
	 directory on Windows. Just call it xconq instead.
	 * win32.c (game_homedir): Change _xconq to xconq.
	 
	 Enable the grid menu item also on non-unix platforms.
	 * tkconq.tcl (unix_feature): Remove code that sets it.
	 (default_map_options): Don't set grid to 0 for non-unix.
	 (create_map_menus): Don't declare the grid command 
	 -state $unix_feature.
	 
	Back out of view option fix from 2004-04-18 that 
	interfered with correct saving of some preferences. 
	 * tkconq.tcl (prefs_dialog_option_list): Remove list.
	(ok_preferences): Parse view_option_list instead of 
	prefs_dialog_option_list.
	
	Instead, implement a fix that changes only those view 
	options that cannot be set on a map-by-map basis when 
	the preferences are changed.
	* tkconq.tcl (ok_preferences): Disable code that resets
	the view options for all maps acording to the new default
	view options.

2004-05-03  Jim Kingdon  <kingdon@panix.com>

        * x11/xdraw.c: Rename cell_overlay to xtconq_cell_overlay to avoid
        compiler warning (ui.h also has a cell_overlay).

2004-05-03  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug that caused run_construction to go on a building spree 
	with human-controlled ACP-independent builders.
	* task.c (do_build_task): If creator/builder is ACP-indep, then 
	after it fails its creation lookup, make sure that it calls 
	'find_unit_to_complete' so that it can (generally) fail that 
	search as well, and then go onto the creation code, which will 
	make sure that the right thing gets done.

2004-05-02  Eric McDonald  <mcdonald@phy.cmich.edu>

	Revert to pathfinding that was in use before 2003/11/13, while 
	leaving other changes intact. This reversion is to fix a 
	number of bugs that were never fixed with the new pathfinder. 
	In time, we may carefully reimplement a version of the new 
	pathfinding, but in the interests of using known, working code 
	prior to the impending release, we have opted to fall back to 
	the old pathfinder. (All listed modifications are from the 
	'kernel' directory.)
	* Makefile.in (OBJS): Remove 'path.o' from linkage.
	  (MW32_OBJS): Remove 'path_mw32.o' from linkage.
	  (path.o): Remove dep rules.
	* ai.c (desired_direction_impassable): Revert.
	  (could_be_ferried): Revert.
	  (blocked_by_enemy): Revert.
	  (attack_blockage): Revert.
	* ai.h (blocked_by_enemy): Revert.
	  (attack_blockage): Revert.
	* autotest.c (test_path): Irrelevant; remove.
	  (test_path_disembark): Irrelevant; remove.
	  (autotest): Don't invoke 'test_path' or 'test_path_disembark'.
	* config.h: Remove 'USE_LR_PATHING' and 'USE_LR_PATHING_SOLO' 
	macros.
	* conq.h: Remove 'CMD_*' macros. Remove 'PND_UNMAPPED' macro.
	  (choose_move_direction): Replace Peter's prototype with a 
	truncated one, which is associated with a new wrapper function for 
	'choose_move_dirs'.
	  (get_cached_move_direction): Revert out of existence.
	  (pathway_transport_change): Likewise.
	  (struct path_node_data): Likewise.
	  (path_node_data_index): Likewise.
	  (same_path_nodes): Likewise.
	  (set_path_node_from_key): Likewise.
	  (get_path_cost_estimate): Likewise.
	  (get_path_direction_count): Likewise.
	  (set_dir_path_node_data): Likewise.
	  (cost_to_move_on_path): Likewise.
	  (path_get_next_move): Likewise.
	  (path_get_next_cached_move): Likewise.
	  (path_get_next_cached_node): Likewise.
	  (select_better_path_node): Likewise.
	  (path_clear_cache): Likewise.
	  (choose_move_dirs): Revert into existence.
	  (plausible_move_dir): Likewise.
	* dir.h: Remove 'NUMPATHS' macro.
	  (DIRX): Revert back to 6 basic direction elements.
	  (DIRY): Likewise.
	  (diropp): Revert out of existence.
	  (opposite_dir): Revert back to formula macro.
	* iplayer.c (iplayer_react_to_task_result): Revert.
	* move.c (set_node_data): Revert out of existence.
	  (do_move_action): Revert.
	  (can_be_carried): Revert out of existence.
	  (path_cb_cnt): Likewise.
	  (check_border_slides): Likewise.
	  (unit_can_border_slide): Likewise.
	  (pathable_point_for_unit): Likewise.
	  (pathable_point): Likewise.
	  (target_distance): Likewise.
	  (choose_move_direction): Likewise, and then replace as a wrapper 
	to 'choose_move_dirs'.
	  (pathway_transport_change): Revert out of existence.
	  (get_cached_move_direction): Likewise.
	  (path_node_data_index): Likewise.
	  (same_path_nodes): Likewise.
	  (set_path_node_from_key): Likewise.
	  (set_path_cost_estimate): Likewise.
	  (get_path_direction_count): Likewise.
	  (set_dir_path_node_data): Likewise.
	  (cost_to_move_on_path): Likewise.
	  (select_better_path_node): Likewise.
	* mplayer.c (mplayer_react_to_task_result): Revert.
	* path.c: Ifdef out the entire file, and put bold comments at 
	the beginning and end mentioning that its contents are not 
	presently used.
	* plan.c (plan_exploration): Change arguments to 
	'choose_move_direction' calls to match new wrapper's param list.
	* task.c (enum choicestate): Revert back into existence.
	  (compare_directions): Likewise.
	  (do_approach_subtask): Revert.
	  (could_directly_board_ferry): Revert out of existence.
	  (do_move_to_task): Revert, keeping non-pathfinding-related 
	changes intact.
	  (do_occupy_task): Likewise.
	  (do_pickup_task): Likewise.
	  (choose_move_direction): Wrapper to replace a major function 
	from Peter's pathfinder. Simply calls 'choose_move_dirs' and 
	then does a 'do_move_action'-like check to see if a unit type 
	can occupy a given cell. (Could certainly use improvement.)
	  (choose_move_dirs): Revert back into existence.
	  (plausible_move_dir): Likewise.
	  (compare_directions): Likewise.
	  (sort_directions): Likewise.
	  (create_move_to_task): Revert.
	  (create_occupy_task): Revert.
	* ui.c (impl_move_to): Change arguments to 'choose_move_direction' 
	call to match new wrapper's param list.
	* unit.c (unit_can_build_type_at): Likewise.
	* util.c (dirx): Revert.
	  (diry): Revert.
	  (diropp): Revert out of existence.
	* world.c (closest_dir): Revert.

2004-05-01  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update documentation.
	* doc/refman.texi: Add entries for 'occupant-adds-speed' and 
	'occupant-multiplies-speed'. Remove entry for 
	'speed-occupant-effect'.

2004-05-01  Hans Ronne <hronne@comhem.se>

	Update the pre-release version date.
	* version.h (VERSION): Change to May 2004.

	Fix crashes in MacOS X when adjusting the direction of 
	the cursor outside the area.
	* ui.c (nearest_cell): Test that xfp and yfp exist before 
	trying to set them to zero.

2004-04-30  Eric McDonald  <mcdonald@phy.cmich.edu>

	Enhance occupant effects on speed.
	* move.c (unit_speed): Handle additive effects first, and then 
	multiplicative effects. Incorporate the two new occupant effects 
	tables and get rid of the old one.
	* table.def (uu_occ_adds_speed): New table.
	  (uu_occ_multiplies_speed): New table.
	  (uu_speed_occ_effect): Remove table. Replaced by 
	'uu_occ_multiplies_speed'. No games needed to be updated as a 
	result of this replacement.

	Fix building bug. Bug would sometimes prevent a new build from 
	occuring because the old 'creation_id' field was not cleared 
	in some circumstances. Completed unit would be looked up and the 
	new build task would complete prematurely.
	* task.c (do_build_task): Before writing a re-entered task off as 
	complete, reset the builder's 'creation_id'.

2004-04-27  Hans Ronne <hronne@comhem.se>

	Fix runaway building bug for acp-independent units.
	* task.c (do_build_task): Always use task->args[1] to find
	the build target for acp-independent units. Comment in the
	resume build code. Note: should teach the acp-independent
	build code how to handle unit->creation_id.

2004-04-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Ifdef out section of revised build code that left advanced units
	creating things at an unchecked rate in some games. Also fix 
	space-expanded tabs in that part of the code.
	* task.c (do_build_task): Don't attempt to resume builds of units 
	with known ID's. (At least for now, until I discover the 
	underlying problem.)

2004-04-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update Windows build/install document.
	* INSTALL-win.txt: Add MSVC6 build instructions supplied via 
	private email from Martin Fehlhaber. Thanks Martin.

2004-04-27  Hans Ronne <hronne@comhem.se>

	Minor fix to the Mac PPC terrain drawing code.
	* macmap.c (update_grid_leakage): Set map->leaky_grid
	to true if map->draw_transitions is on.

2004-04-26  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix Tcl/Tk create/build interface bugs. The first bug was the 
        prefix arg that was not reset after a successful build; if a 
        player had supplied "1" as the prefix for the first build, and 
        then wanted to supply "1" again for the next build target, 
        he/she would get "11" as the prefix; it was not just a display 
        glitch, the argument was quite annoyingly real. The second bug 
        was the unit type of a previously cancelled build was being 
        recycled on a different (or same) unit's next build request; this 
        was because 'aux_build' was not deactivating itself as the map 
        modal handler when it was cancelled, and was thus being 
        reactivated by 'tk_interp_key' after the prefix was supplied.
        * tcltk/tkconq.tcl (clear_command_line): Also delete the 
        'prefixarg' text.
        * tcltk/tkcmd.c (do_build): Reset the 'inptype' to NONUTYPE, 
        the 'prefixarg' to -1, and the 'modalhandler' to NULL, and clear 
        the command line after a successful build.
          (aux_build): Likewise, but also after a cancel.
          (aux_build_2): Likewise, but also after a cancel.

2004-04-25  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add the 'creation_id' field to the network checksum.
        * tp.c (game_checksum)

2004-04-25  Eric McDonald  <mcdonald@phy.cmich.edu>

        Be more conservative with resetting the 'creation_id' field 
        because some odd cases, where 'creation_id' has been reset but 
        the 2nd task arg of the build task is not set either, were still 
        getting through. Now reset 'creation_id' only on verified 
        completion of the unit being built or upon creation of a new one.
        (There are additional cases where a low supply condition prevents 
        creation, and so neither the task arg or the 'creation_id' get set. 
        Dealing with these cases is even trickier, in terms of assumptions.)
        * actions.c (do_build_action): Do not reset 'creation_id' here.
        * task.c (do_build_task): Reset 'creation_id' if we are about to 
        attempt creating a new unit. Resetting the ID here saves us from 
        getting sidetracked on the next pass through the build code if the 
        creation attempt failed.

        Finish fixing the misguided creation/building bug.
        * task.c (do_build_task): Only look for nearest incomplete units to 
        work upon if the builder is not directly human-controlled. If the 
        builder is directly human-controlled, then create a new unit if the 
        type and location of any existing incomplete unit do not match the 
        specified build criteria. If the criteria are matched, then help 
        work on the incomplete unit.

        Reformat some code to be readable on an 80 column display.
        * unit.c (incomplete_build_target)

2004-04-25  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix "runaway creation spree" bug. This would occur in two forms.
        The first is where the creator completed the created unit as a 
        result of the creation action (i.e., it supplied all of the 
        needed CP upon creation), and thus would not have a chance to 
        acquire the created unit's ID for future reference. The second 
        form is where the creator would create a unit, and then another 
        unit would build it to completion before the next turn; this too 
        resulted in the creator not acquiring the created unit's ID. Both 
        forms of this bug stemmed from the fact that the build task would 
        opt to create a new unit, if the old one could not be looked up by 
        ID, and no incomplete units could be found in the build range. Thus 
        one would get endless creation (until supplies or all volume in 
        creation/build range became exhausted).
        * unit.h (struct a_unit): Add 'creation_id' int field to the 
        core unit structure.
        * unit.c (create_unit): Set the default value of the 
        'creation_id' field to 0.
        * keyword.def (K_CREATION_ID): New keyword.
        * read.c (interp_unit): Read the 'creation-id' property into 
        the unit's 'creation_id' field.
        * write.c (write_unit_properties): Write the 'creation-id' 
        property to the unit's form from the unit's 'creation_id' 
        field.
        * actions.c (do_create_in_action): Assign creator's 
        'creation_id' field the new unit's ID.
          (do_create_at_action): Likewise.
          (do_build_action): Reset the builder's 'creation_id' if 
        executing a build action.
        * task.c (do_build_task): If the worked upon unit's ID is stored 
        in either the 2nd task arg or else in the creator's 'creation_id' 
        then look the worked upon unit up by its ID. If that unit turns 
        out to be complete, then reset the creator's 'creation_id' field.
        * doc/refman.texi (creation-id): New entry in "Unit Properties" 
        section.

        Fix harmless build glitch that allowed completeness numerators 
        to be greater than the corresponding denominators.
        * actions.c (do_build_action): Choose the lesser of the 
        uu_cp_per_build entry and the remaining CP needed, when adding to 
        the CP of the unit.

        Partially fix the misdirected builds bug.
        * task.c (do_build_task): If the worked upon unit can be looked 
        up via its ID, then continue work upon it, rather than groping 
        around for the first thing the builder can help build, which 
        oft times as not, is not what the player wanted. (Fixing the 
        problem of new creation being substituted for building an 
        existing unit is somewhat more involved, but I hope to address 
        this shortly.)

2004-04-25  Hans Ronne <hronne@comhem.se>

	Implement a general protection against out-of-bounds access
	to area layers by making the accessor macros check in_area.
	* world.h (aref, aset, aadd): Check in_area(x,y) first.
	* side.h (add_cover): Use aadd instead of aref so that it works
	with the new accessor macros.

	Fix crashes in the Mac PPC interface when clicking in the area
	below the map. Add some player feedback in that case.
	* macmouse.c (move_the_selected_unit): Check the return value
	of m_nearest_cell and return false if it is false. Notify dside with 
	the message "Cannot move unit outside the map!".
	
	Fix bug in the common ui code that would return a valid nearest 
	cell also for points to the left of or below the edges of the map.
	* ui.c (nearest_cell): Set *yp to (-1) if sy > vp->totsh 
	and *xp to (-1) if sxadj < 0.

2004-04-24  Hans Ronne <hronne@comhem.se>

	Fix so that the SDL interface compiles again.
	* sdlmap.c (m_seen_border): Remove macro now defined in ui.h.
	(m_terrain_visible): Remove macro now defined in ui.h.
	(cell_drawing_info): Pass map->vp instead of map to macros.
	(draw_borders): Pass map->vp instead of map to macros.
	(draw_borders_iso): Pass map->vp instead of map to macros.
	(draw_connections): Pass map->vp instead of map to macros.
	(draw_connections_iso): Pass map->vp instead of map to macros.
	(draw_clouds_row): Pass map->vp instead of map to macros.
	(draw_temperature_row): Pass map->vp instead of map to macros.
	(draw_feature_boundary): Pass map->vp instead of map to macros.
	(draw_people): Pass map->vp instead of map to macros.

	Remove bogus dependency of mac.c (and thus the Mac 
	tcltk and SDL apps) on the Mac PPC interface code.
	* mac.c (macdefs.h): Don't include it 
	(macheads.h): Don't include it.
	
	Add basic Apple Event handling to IMFApp so that it can 
	accept quit application events.
	* imfapp.c (hasAppleEvents): New global int.
	(eventloopdone): New global int.
	(do_ae_open_application_proc): New global AEEventHandlerUPP.
	(do_ae_open_documents_proc): New global AEEventHandlerUPP.
	(do_ae_print_documents_proc): New global AEEventHandlerUPP.
	(do_ae_quit_application_proc): New global AEEventHandlerUPP.
	(main): Call init_ae and event_loop. Move content to event_loop.
	(event_loop): New function and prototype with content from main.
	(init_ae): New function and prototype.
	(do_ae_open_application): New function and prototype.
	(do_ae_open_documents): New function and prototype.
	(do_ae_print_documents): New function and prototype.
	(do_ae_quit_application): New function and prototype.
	(do_event): Handle case kHighLevelEvent.
	
2004-04-24  Hans Ronne <hronne@comhem.se>

	Fix grid drawing bug in the Mac PPC interface.
	* macdraw.c (draw_hex_region): Test dogrid when deciding
	whether to use CopyMask or CopyBits.

2004-04-24  Eric McDonald  <mcdonald@phy.cmich.edu>

        Update documentation.
        * doc/PROJECTS (K373): Mention the idea of a treasury 
        reservations system (think malloc/free for side treasuries).
          (L115): Mention an idea that Klaus Schilling posted to the 
        list late last year: a database tool that reads/writes GDL. 
        This would make building complex games so much easier.
        * doc/refman.texi (material-to-create): Mention new usage, and 
        use unit identifier 'u1' with it. Mention that material is not 
        consumed.
          (consumption-on-creation): Use unit identifier 'u2' with it.
          (material-to-build): Mention that material is not consumed.

        Transplant '*consumes_from_treasury_directly' macros from 
        'conq.h' to a new miscellany section of 'kernel.h'. Add 
        '*produces_for_treasury_directly' macros in the new location.
        * conq.h (type_consumes_from_treasury_directly): Remove.
          (consumes_from_treasury_directly): Remove.
        * kernel.h (type_consumes_from_treasury_directly): Add here.
          (consumes_from_treasury_directly): Add here.
          (type_produces_for_treasury_directly): New macro. Does the 
        given unit type supply the given material to the treasury of 
        the given side directly?
          (produces_for_treasury_directly): New macro. Does the given 
        unit supply the given material to its side's treasury directly?

        Make mention of the new direct treasury interactions in the 
        relevant functions.
        * ai.c (exploring_worth)
        * help.c (describe_mtype)
        * unit.c (operating_range_worst, real_operating_range_worst, 
        operating_range_best, real_operating_range_best)

        Add support for direct treasury withdrawals to cover base 
        consumption costs. Add support for direct treasury investments 
        for excess materials from base production.
        * unit.h (unit_side_treasury): New macro. Alternate way to access 
        a unit's side treasury through the unit struct.
        * run2.c (run_unit_base_consumption): Add case to see if treasury 
        has enough material to pick up the consumption tab, if the 
        particular unit can directly withdraw the particular material 
        from the treasury.
          (run_economy): If excess material remains after pushing it 
        out on the supply lines, and the given unit can directly deposit 
        the given material in its side treasury, then go ahead and deposit 
        the remaining excess of that material.

        Safen a macro.
        * unit.h (unit_doctrine): Wrap references to 'unit' in parens in 
        the macro body.

2004-04-23  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix compilation failure with SDL and Xt/Xaw interfaces.
        * ui.h (enum whattouse): Add 'usepictures' to the enumeration.
        * sdl/sdlconq.h: Delete 'enum whattouse'.
        * x11/xtconq.h: Likewise.

        Fix long-standing incomplete unit list issue. Also, address 
        oversight in change-type code.
        * unit.c (type_ever_available): Add tests for a unit that can 
        be added to a side via capture, changing type, or wrecking.
          (type_can_change_type): Remove function.
          (could_change_type_to): Looks up utype pair in 
        'uu_change_type_to' table, before inquiring about ACP-independence
        or ACP-based restrictions.
          (could_change_type): Replace 'type_can_change_type' with this. 
        Call new function, 'could_change_type_to', inside of utype loop.
          (can_change_type): Call 'could_change_type' instead of 
        'type_can_change_type'.
        * unit.h (type_can_change_type): Remove prototype.
          (could_change_type): New prototype.
          (could_change_type_to): New prototype.

2004-04-23  Hans Ronne <hronne@comhem.se>

	Fix bug in modal_map code from 2003-12-31 that would lock 
	the Mac PPC interface in modal mode under some circumstances.
	* macconq.c (maybe_select_next_unit): Reset map_modal to
	NO_MODAL if we lack a current unit than can act. This fixed most 
	of the problems, but it is still possible to get locked if the unit has 
	acps, but not enough to execute the chosen action. Should really do
	like the tcltk interface where actions are checked at the command
	level and feedback provided on failure.
	* macmouse.c (do_mouse_down_map_content): Reenable restting
	of map_modal to NO_MODAL for now, until the command code has 
	been improved.

	Remove bogus cloverleaf shortcut for the fire-into command 
	in the Mac PPC Play menu. Instead, add [ ctrl-f ] which is the
	real shortcut in all interfaces for fire-into. Note: this was a 
	truly ancient bug, present already in 7.4.1 (but not 7.1.0).
	* Xconq.r (MENU 132 "Play"): Remove cloverleaf mark and
	add [ ctrl-f ] after Fire Into instead.
	
	Add menu accelerators for fire and fire-into commands in the 
	tcltk interface for consistency across platforms.
	* tkconq.tcl (create_map_menus): Add -accelerator "f" for
	Fire and -accelerator "Ctrl-f" for Fire Into. Also add "m" for 
	Move.

2004-04-22  Hans Ronne <hronne@comhem.se>

	Add application bundle support for building the MacOS X apps.
	* mac/IMFApp.app: New folder.
	* mac/IMFApp.app/Contents: New folder.
	* mac/IMFApp.app/Contents/MacOS: New folder.
	* mac/IMFApp.app/Contents/Resources: New folder.
	* mac/IMFApp.app/Contents/Resources/IMFApp.icns: New file.
	* mac/IMFApp.app/Contents/info.plist: New file.
	* mac/IMFApp.app/Contents/PkgInfo: New file.
	* mac/Xconq.app: New folder.
	* mac/Xconq.app/Contents: New folder.
	* mac/Xconq.app/Contents/MacOS: New folder.
	* mac/Xconq.app/Contents/Resources: New folder.
	* mac/Xconq.app/Contents/Resources/Xconq.icns: New file.
	* mac/Xconq.app/Contents/info.plist: New file.
	* mac/Xconq.app/Contents/PkgInfo: New file.
	
2004-04-22  Hans Ronne <hronne@comhem.se>

	Add user-settable preferences for default_moveonclick and 
	default_autojumpnext in the Mac PPC interface.
	* macconq.h (defaultmoveonclick): Change to default_moveonclick.
	(defaultautoselect): Change to default_autojumpnext.
	* macconq.c (defaultmoveonclick): Remove global.
	(defaultautoselect): Remove global.
	* maccolors.c (default_moveonclick): Initialize to true.
	(default_autojumpnext): Initialize to true.
	* macdefs.h (diPrefsMoveOnClick): Define as 28.
	(diPrefsAutoJumpNext): Define as 29.
	* macmap.c (create_map): Change defaultmoveonclick and
	defaultautoselect to default_moveonclick and default_autojumpnext.
	* macprefs.c (ui_update_state): Handle default_moveonclick 
	and default_autojumpnext.
	(interp_mac_ui_data): Handle default_moveonclick and 
	default_autojumpnext.
	(set_preferences): Handle cases diPrefsMoveOnClick and
	diPrefsAutoJumpNext.
	(add_preferences_topic_items): Set diPrefsMoveOnClick
	and diPrefsAutoJumpNext. Change defaultmoveonclick and
	defaultautoselect to default_moveonclick and default_autojumpnext.
	(save_preferences_settings): Save default_moveonclick
	and diPrefsAutoJumpNext.
	and default_autojumpnext.
	* Xconq.r (DITL 700 "Preferences"): Tweak button positions.
	(DITL 702 "Preferences Map"): Add checkboxes for 
	diPrefsMoveOnClick and diPrefsAutoJumpNext.
	(DLOG 700 "Preferences"): Tweak size.

2004-04-21  Hans Ronne <hronne@comhem.se>

	Fix MacOS X crashes in get_a_visible_unit. Note: the culprit 
	here is really nearest_unit, which returns true even if no unit 
	was found. Should consider changing that. Thanks to Tom Schaub
	for reporting this and other bugs.
	* maccmd.c (get_a_visible_unit): Return false if unitp does 
	not exist.

	Remove the possibility of setting defaultmoveonclick and
	defaultautoselect from the Mac Side menu when there is no
	frontmap since this was confusing to players. Instead, uncheck 
	and disable these items in the absence of a frontmap. Note: these
	map-specific items should really be moved to the View menu.
	Should also make defaultmoveonclick and defaultautoselect user
	settable map preferences. Further note: the tcltk interface is
	similarly illogical since it allows toggling of the map-specific
	Move/Survey mode from the Side menu.
	* macmenus.c (moveonclick_mi): Call beep instead of toggling
	defaultmoveonclick if no frontmap.
	(autoselect_mi): Call beep instead of toggling defaultautoselect 
	if no frontmap.
	(adjust_menus): Call adjust_menu_item for miSideMoveOnClick
	and miSideAutoSelect with map as argument. Uncheck these items
	if there is no map. 

	Fix unwanted redrawing of invisible control panel when
	Move on Click is toggled in the Mac Side menu.
	* macmenus.c (moveonclick_mi): Test frontmap->conw
	before calling draw_control_panel.

	Fix map scrolling bug in the Mac interface.
	* macconq.c (adjust_cursor): Only do autoscrolling if the
	current process is the front process and the window is the
	topWindow.

	Fix Carbon-specific menu switching bug in the Mac interface.
	* macconq.c (handle_event): Check if the window should be
	brought to the front also in case inDrag.

2004-04-21  Eric McDonald  <mcdonald@phy.cmich.edu>

        Match the usage of um_to_create and um_consumption_on_creation 
        to the usage of um_to_build and um_consumption_per_build; was 
        inconsistent. Also, improve creation/building to draw directly 
        from a side treasury if the side has one, the unit can draw from 
        it, and the unit has no local storage for the material.
        * conq.h (type_consumes_from_treasury_directly): New macro. 
        Checks to see if a given type on a given side can consume a given 
        material directly from the side treasury.
          (consumes_from_treasury_directly): New macro. Checks to see if 
        a given unit can consume a given material directly from the side 
        treasury.
        * actions.c (check_create_common): Allow direct withdrawals from 
        treasury. Make um_to_create dependent on creator rather than 
        the potential creation (to mirror usage of um_to_build in 
        building).
          (check_build_action): Allow direct withdrawals from treasury.
          (do_create_in_action): Perform direct withdrawals from treasury, 
        if allowed and necessary.
          (do_create_at_action): Likewise.
          (do_build_action): Likewise.

        Fix a minor bug that prevented a unit from being created inside a 
        transport that could exactly fit it with no space leftover.
        * task.c (do_build_task): Occ size should <= transport cap, not 
        just < transport cap.

        Reformat code and comments to be readable on 80 column display.
        * unit.c (unit_can_build_type_at): Also add comment questioning 
        the wisdom of restricting creation range with the min of 
        creation range and build range.

        Update games lib to reflect new usage of um_to_create.
        * lib/galaxy.g (material-to-create): Change to 
        'consumption-on-creation', which was probably the author's intent 
        anyway.
        * lib/u-bellum.g (material-to-create): Remove. Wasn't really used 
        anyway.

        Trick Tcl into not treating the string escape character, '"', in 
        a special manner.
        * tkmain.c (c_to_tcl_string): Provide octal escape code for 
        string escape.

2004-04-18  Hans Ronne <hronne@comhem.se>

	Fic display glitch in the Mac PPC pseudo-isometric code.
	* macrow.c (draw_row): Don't draw terrain transitions
	in the pseudo-isometric case.
	
	Fix bug in the tcltk interface that would reset map power and
	coverage to default values whenever a preference was changed.
	* tkconq.tcl (prefs_dialog_option_list): New list with only 
	those view options that can be set in the prefs dialog.
	(ok_preferences): Parse prefs_dialog_option_list instead 
	of view_option_list.

2004-04-17  Hans Ronne <hronne@comhem.se>

	Further improvements to the tcltk map drawing code. Add the
	ability to draw isometric polygons to the Windows interface.
	* ui.h (iws[], ihs[], ics[], ix1[], ix2[]): Declare new global
	arrays for use in isometric cell drawing.
	* ui.c (iws[NUMPOWERS]): Initialize array.
	(ihs[NUMPOWERS]): Initialize array.
	(ics[NUMPOWERS]): Initialize array.
	(ix1[NUMPOWERS]): Initialize array.
	(ix2[NUMPOWERS]): Initialize array.

	* tkmap.c (draw_iso_polygon): New function and prototype.
	(draw_terrain_iso): Rewrite. Call draw_iso_polygon in case
	use_clip_mask is false (Windows). Fix various bugs. Use
	grid_color instead of blackcolor for the grid and draw it after
	coatings and coverage, just as in the overhead drawing code.
	(draw_terrain_row): Rewrite and reformat so that it is more 
	similar to draw_terrain_iso.
	* tkxmac.c (XFillPolygon): Add support for stippled and tiled
	drawing. Use PenSize(0, 0) instead of PenPixPat(gPenPat) to 
	avoid drawing a black edge. 

	Fix crashes in the tcltk terrain transition code.
	* tkmap.c (draw_terrain_transitions): Check that timg 
	exists before dereferencing it.
	
2004-04-15  Eric McDonald  <mcdonald@phy.cmich.edu>

        Trick Tcl into not trying to treat the command substitution 
        character, '[', in a special manner. Also, improve handling of 
        backslash substitution.
        * tkconq.h (c_to_tcl_string): New prototype.
        * tkmain.c (c_to_tcl_string): New function. Converts a "raw" C 
        string to a new dynamically allocated C string that is properly 
        digestible by a Tcl interpreter. The raw string is freed by the 
        function after conversion takes place. 
          (init_unit_type_list): Use the 'c_to_tcl_string' function.

        * game.h (BACKTTYPE): Fix nested comment.

2004-04-09  Hans Ronne <hronne@comhem.se>

	Improve drawing of isometric terrain images on Windows.
	* tkmap.c (draw_terrain_iso): Use XSetFunction GXand on
	Windows to draw a black mask underneath, and then GXor.

2004-04-09  Hans Ronne <hronne@comhem.se>

	Fix bug in Mac Tcl/Tk 8.4.2 that would cause polygons to 
	be drawn with a black edge.
	* tkxmac.c (XFillPolygon): New hacked function that sets
	PenPixPat(gPenPat) before framing the polygon.

2004-04-08  Hans Ronne <hronne@comhem.se>

	Fix bug that would leave a hole in some cases when redrawing
	part of the tcltk map near a high peak in isometric mode.
	* tkmap.c (draw_map_isometric): Add 5 to numrows in case
	SOUTHWEST and NORTHWEST. Note: 5 seems to be enough, but
	should perhaps add area.width rows like in all other cases?

2004-04-07  Hans Ronne <hronne@comhem.se>

	Fix pointer type mismatch in the new tcltk code.
	* tkmap.c (draw_terrain_iso): Pass unseen_image instead 
	of dside->ui->best_unseen_images to best_image.	

	Don't draw a black area background in the isometric case. Fix bug
	that caused occasional slits between cells by testing drop for being
	non-zero before scaling it. 
	* tkmap.c (draw_terrain_iso): Test drop for being greater than
	zero before scaling it. Remove code that draws grid lines in case 
	elevations_defined is true and the drop is zero.
	(draw_map_widget): Only call draw_area_background in the 
	non-isometric case.

2004-04-06  Hans Ronne <hronne@comhem.se>

	Major overhaul of the tcltk map drawing code. Port several
	improvements from the Mac PPC interface and generalize some
	of the code by moving it to the kernel. Add the ability to explicitly 
	draw unseen terrain and bogus window background terrain in order
	to enable correct drawing at map edges and outside the map. Separate
	drawing of overlays and coatings and make both work together as in 
	the Mac PPC interface. Fix some bugs in both interfaces.
	* game.h (BACKTTYPE): Define as (-2) here.
	* ui.c (compute_transition): Return FALSE if (x, y) is invisible.
	Add code from mac_compute_transition that handles overlays and
	shorelines.
	* ui.h (whattouse): Move enum of drawing styles here.
	(a_vp): Add vp->draw_shorelines.
	(m_terrain_visible): Move macro here.
	(m_seen_border): Move macro here.
	(cell_style): Move macro here.
	(cell_overlay): Move macro here.
	(cell_terrain): Move macro here.

	* macconq.h (a_map): Remove map->shorelines.
	(enum dontdraw etc): Move it to ui.h. Remove usepictures.
	(BACKTTYPE): Move definition to game.h.
	* macdraw.c (m_terrain_visible): Move macro to ui.h.
	(m_seen_border): Move macro to ui.h.
	(cell_style): Move macro to ui.h.
	(cell_overlay): Move macro to ui.h.
	(mac_compute_transition): Remove function and prototype.
	(draw_cell_block): Break before drawing coatings or overlays
	if the terrain is unseen.	
	(draw_hex-region): Break before drawing coatings or overlays
	if the terrain is unseen.
	(draw_terrain_transitions): Pass map->vp instead of map in
	all macros. Call compute_transition instead of the mac-specific
	function but shift the viewport afterwards to compensate for the
	xform_cell call.
	(draw_unseen_fuzz): Pass map->vp instead of map in all macros. 
	(draw_shore_images): Pass map->vp instead of map in all macros. 
	(draw_border_images): Pass map->vp instead of map in all macros.
	* macmap.c (create_map): Set map->vp->draw_shorelines instead
	of map->shorelines.
	* macmenus.c (adjust_menus): Change map->shorelines to
	map->vp->draw-shorelines.
	(toggle_shorelines): Change map->shorelines to
	map->vp->draw-shorelines.
	* macrow.c (tmpdrawlighting): Remove tmp global.
	(tmpdrawcoverage): Remove tmp global.
	(m_terrain_visible): Move macro to ui.h.
	(m_seen_border): Move macro to ui.h.
	(cell_style): Move macro to ui.h.
	(cell_overlay): Include handling of tmpdrawlighting and
	tmpdrawcoverage here and move the macro to ui.h.
	(cell_terrain): Move macro to ui.h.
	(draw_row): Pass map->vp instead of map in all macros. Change 
	map->shorelines to map->vp->draw-shorelines.
	(draw_terrain_row): Pass map->vp instead of map in all macros.
	Remove tmpdrawlighting and tmpdrawcoverage. Remove unused
	usepictures drawing style.
	(draw_cliffs): Pass map->vp instead of map in all macros. 
	(draw_contours): Pass map->vp instead of map in all macros. 
	(draw_gridlines): Pass map->vp instead of map in all macros. 
	(draw_shores): Pass map->vp instead of map in all macros. 
	(draw_shorelines): Pass map->vp instead of map in all macros. 
	(draw_borders): Pass map->vp instead of map in all macros.
	Remove tmpdrawlighting and tmpdrawcoverage.
	(draw_connections): Pass map->vp instead of map in all macros.
	Remove tmpdrawlighting and tmpdrawcoverage.
	(draw_feature_boundary): Pass map->vp instead of map in all
	macros.
	(draw_people_row): Pass map->vp instead of map in all macros.
	(draw_materials): Pass map->vp instead of map in all macros.
	(draw_units): Pass map->vp instead of map in all macros.
	(draw_unit_and_occs): Pass map->vp instead of map in all macros.
	(draw_unit_view_and_occs): Pass map->vp instead of map in all 
	macros.
	(draw_ai_region): Pass map->vp instead of map in all macros.
	(draw_region_borders): Pass map->vp instead of map in all macros.
	
	* tkconq.h (whattouse): Move enum to ui.h. Remove usepictures.
	(a_ui): Add (Image *) best_unseen_images[NUMPOWERS].
	* tkinit.c (init_terrain_images): Call get_unseen_images. 
	Allocate and init dside->ui->best_unseen_images.
	* tkmap.c (m_terrain_visible): Move macro to ui.h.
	(m_seen_border): Move macro to ui.h.
	(MapW): Remove unused mapw->draw_polygons.
	(config_specs): Don't config mapw->draw_polygons. 
	(draw_hex_polygon): Remove some unused arguments. Separate
	drawing of overlays and coatings.
	(cell_drawing_info): Remove function and prototype.
	(cell_drawing_colors): New simplified function and prototype.
	(mapw_cmd): Don't set mapw->draw_polygons.
	(draw_terrain_iso): Rewrite to work more like the Mac PPC
	interface. Use macros from ui.h instead of cell_drawing_info.
	Split code for handling overlays and coatings. Use cell_terrain
	instead of terrain_at. Use unseen_color to draw cliffs if the
	terrain is NONTTYPE. Break before drawing coatings or overlays
	if the terrain is unseen.
	(draw_terrain_row): Rewrite to work more like the Mac PPC
	interface. Use macros from ui.h instead of cell_drawing_info.
	Split code for handling overlays and coatings. Rename usepictures
	to usepolygons for consistency with the Mac PPC interface and
	remove th unused former usepolygons case. Pass fewer arguments
	to draw_hex_polygon. Break before drawing coatings or overlays
	if the terrain is unseen.
	(draw_terrain_transitions): Rewrite to work more like the Mac 
	PPC interface. Use macros from ui.h instead of cell_drawing_info.
	Use cell_terrain instead of terrain_at. Split code for handling 
	overlays and coatings.
	(draw_unseen_fuzz): Pass mapw->vp instead of mapw in all macros.
	(draw_contours): Pass mapw->vp instead of mapw in all macros.
	(draw_clouds_row): Pass mapw->vp instead of mapw in all macros.
	(draw_temperature_row): Pass mapw->vp instead of mapw in all 
	macros.
	(draw_people): Pass mapw->vp instead of mapw in all macros.
	(draw_borders): Pass mapw->vp instead of mapw in all macros.
	(draw_borders_iso): Pass mapw->vp instead of mapw in all macros.
	(draw_connections): Pass mapw->vp instead of mapw in all macros.
	(draw_connections_iso): Pass mapw->vp instead of mapw in all 
	macros.
	(draw_feature_boundary): Pass mapw->vp instead of mapw in all 
	macros.

2004-04-03  Hans Ronne <hronne@comhem.se>

	Fix so that the number of entries and empty fields in the tcltk
	player setup list is recomputed correctly when the indepside is
	hidden or revealed.
	* tkconq.tcl (add_player_dialog_items): Check $indepside_up
	before adding one extra row for indepside. 
	(set_indepside): Add one row if indepside is visible. Recompute
	the length of the player list when done.

2004-04-02  Hans Ronne <hronne@comhem.se>

	Update the pre-release version date.
	* version.h (VERSION): Change to April 2004.

	Fix rare synch error affecting games with auto-repair.
	* task.c (do_repair_task): Initialize tmpunit correctly before 
	calling repair_here. Also add a missing linefeed at the end of the
	DMprintf output.

2004-03-29  Hans Ronne <hronne@comhem.se>

	Fix bug in the native Mac interface that would cause an empty
	text window to disappear if its zoom box was clicked.
	* macconq.c (set_standard_state): Set fullh to min 10 pixels.
	(set_vertical_standard_state): Set fullh to min 10 pixels.

	Fix minor compile problem in the Mac tcltk code.
	* tkmac.c (open_game_from_fsspec): Add missing prototype.

2004-03-28  Hans Ronne <hronne@comhem.se>

	Add Mac command key shortcuts in the tcltk apps. Note:
	commands were taken from the Mac native apps. Should 
	review command key shortcuts in all interfaces and unify 
	them as much as possible.
	* imfapp.tcl: Add Mac command keys as accelerators. Also
	set all menus to -tearoff 0 and change "About IMFAppTCL..."
	to "About IMFApp..." in the Apple menu.
	* tkconq.tcl (create_map_menus): Add Mac command keys
	as accelerators. Change "About XconqTCL.." to "About Xconq"
	in the Apple menu.

2004-03-28  Hans Ronne <hronne@comhem.se>

	Improve the appearance of the unseen fuzz.
	* images/fuzz24x26.gif: Remove some nicks and bumps.
	* images/fuzz44x48.gif: Remove some nicks and bumps.
	* images/fuzz88x96.gif: Remove some nicks and bumps.
	* bitmaps/fuzz16.b: Remove some nicks and bumps.
	* bitmaps/fuzz32.b: Remove some nicks and bumps.
	* bitmaps/fuzz64.b: Remove some nicks and bumps.

2004-03-27  Hans Ronne <hronne@comhem.se>

	Fix long-standing problem with excessive updates of the map
	outline rect in the tcltk worldmap which caused an annoying
	flicker and eventually locked up the MacTCL interface. Also
	fix so that the corners of the map rect are drawn correctly. 
	* tkmain.c (tk_animate_selection): Now call update_cell also
	in survey mode in order to force updates of the worldmap map
	outline after scrolling etc.
	* tkmap.c (mapw_cmd): Initialize mapw->last_ws_valid to
	FALSE (not needed but may prevent future problems).
	(mapw_widget_cmd): Add some brackets.
	(mapw_display): Add some brackets.
	(draw_map_outline): Rewrite. Only draw line segments that
	intersect the update rect. Fix so that segments do not overlap
	in the corners. Add code that tests if the map was moved and
	forces a redraw in that case. Only reset wsx and wsy after the
	new outline is drawn, not after erasing the old one. Reenable
	the code also in the MacTCL interface.
	
	Fix bug in currently unused scale_point calls in the tcltk
	interface and enable this function for future use.
	* tkmap.c (draw_map_outline): Switch widgets in call to
	scale_point. Add another commented out call for the standard
	non-isometric case.
	* ui.h (scale_point): Add prototype.
	* ui.c (scale_point): Enable function but add comment about
	not working correctly in the isometric case.

2004-03-26  Hans Ronne <hronne@comhem.se>

	Fix so that double-clicking of game files works in the MacTCL 
	interface by porting the relevant Apple Event processing code 
	from the MacPPC interface. Remove some unix-specific stuff 
	from the MacTCL code.
	* tkmac.c (interpret_variants): Remove prototype.
	(cmd_error): Remove prototype.
	(main): Rewrite and remove unix-specific stuff. Don't call
	TkMacInitAppleEvents. Don't use option_popup_new_game_dialog.
	Copy ifdef MACOSX command line code from macconq.c.
	(MissingParameterCheck): Remove function and prototype.
	(DoOpenApp): Remove function and prototype.
	(DoQuitApp): Remove function and prototype.
	(DoOpenDocument): Remove function and prototype.
	(missed_any_parameters): New function and prototype.
	(do_ae_open_application): New function and prototype.
	(do_ae_open_documents): New function and prototype.
	(do_ae_print_documents): New function and prototype.
	(do_ae_quit_application): New function and prototype.
	(open_game_from_fsspec): New function and prototype.	
	(init_ae): Call new event handler procedures instead.
	* tkconq.tcl (popup_splash_screen): Call create_newgame_window
	to set up the window and then add_splash_screen_dialog_items.
	(create_newgame_window): New procedure with most of the 
	content from the old popup_splash_screen.
	(popup_variants_dialog): Call create_newgame_window if
	the .newgame window does not exist.
	(popup_player_dialog): Call create_newgame_window if
	the .newgame window does not exist.

	Clean out unused stuff from the MacTCL and MacPPC interfaces.
	* macconq.c (keyReplyErr): Remove macro for 'errn'.
	(get_files): Remove unused prototype.
	(main): Clean up the ifdef MACOSX code.
	(do_ae_open_application): Use keyErrorNumber instead.
	(do_ae_open_documents): Use keyErrorNumber instead.
	(do_ae_print_documents): Use keyErrorNumber instead.
	(do_ae_quit_application): Use keyErrorNumber instead.
	* tkmac.c (XconqSignature): Remove unused macro.

2004-03-25  Hans Ronne <hronne@comhem.se>

	Remove the empty lib-x11 directory from all modules.
	* modules/modules (xconq-unix): Remove xconq/lib-x11.
	(xconq): Remove xconq/lib-x11.
	
2004-03-24  Hans Ronne <hronne@comhem.se>

	Update BWidget to version 1.7.0.
	tcltk/BWidget: Update all existing files to 1.7.0.
	* wizard.tcl: Add new BWidget file.

2004-03-24  Hans Ronne <hronne@comhem.se>

	Fix display glitch in the tcltk build select buttons.
	* tkconq.tcl (fill_in_unit_type_list): Initialize sy to 1.
	Set width and height to 44 instead of 48 for unit images.

2004-03-24  Hans Ronne <hronne@comhem.se>

	Fix move-to command bug by always enabling moves into the 
	unknown, also when moving under manual control. 
	* move.c (pathable_point): Comment out test for CMD_EXPLORE
	when terrain is unseen. Always set PND_UNMAPPED and add 2
	points to pmcost.
	* task.c (do_move_to_task): Comment out code that sets
	CMD_EXPLORE.

	Rewrite part of the command processing common interface code 
	so that unit views always are used instead of units when trying 
	to figure out what commands are acceptable. Fix so that it is no
	longer possible to figure out if an enemy unit is hiding in a cell
	by clicking on that cell in the process.
	* side.h (for_all_view_stack_with_occs): New macro.
	* unit.c (side_thinks_type_can_occupy_cell): New function.
	(side_thinks_it_can_put_type_at): New function.
	(side_thinks_it_can_put_type_at_without): New function.
	(side_thinks_type_can_occupy): New function.
	(side_thinks_type_can_occupy_without): New function.
	(side_could_put_type_at): Remove function.
	(unit_can_build_type_at): Call side_thinks_it_can_put_type_at 
	and side_thinks_it_can_put_type_at_without instead of
	side_can_put_type_at and side_can_put_type_at_without. 
	* unit.h (side_thinks_type_can_occupy_cell): New prototype.
	(side_thinks_it_can_put_type_at): New prototype.
	(side_thinks_it_can_put_type_at_without): New prototype.
	(side_thinks_type_can_occupy): New prototype.
	(side_thinks_type_can_occupy_without): New prototype.
	(side_could_put_type_at): Remove prototype.
	* ui.c (impl_move_to): Call side_thinks_it_can_put_type_at 
	instead of side_can_put_type_at. Don't check terrain_visible
	here.

	Make it possible to resume builds manually on the Mac also 
	if the destination cell is full. Always enable possible build 
	targets for mobile builders.
	* macunit.c (update_build_menu): Check for incomplete 
	build targets and include the type in the menu. Also enable 
	all build targets if builder is mobile.
	
	Remove obsolete resource include file for CodeWarrior.
	* XconqMWC.r: Remove. The only include currently needed 
	by Rez is Types.r and it can be set as prefix file for Rez in 
	all supported versions of CodeWarrior.

2004-03-10  Hans Ronne <hronne@comhem.se>

	Fix init warnings due to internal zz data that was saved in 
	debug mode being read when a saved game is loaded.
	* read.c (fill_in_utype): Don't read zz-properties.
	(fill_in_mtype): Don't read zz-properties.
	(fill_in_atype): Don't read zz-properties.
	(fill_in_ttype): Don't read zz-properties.
	(interp_table): Don't read zz-tables.

2004-03-10  Hans Ronne <hronne@comhem.se>

	Fix strange bug that would put land units in the middle of lakes 
	if the river-generating code was run after making units.
	* mkrivers.c (make_up_river_borders): Check that no units
	are present in a sink cell before changing it to liquid terrain.

2004-03-07  Hans Ronne <hronne@comhem.se>

        Fix reference to empty filename when loading library modules.
        * module.c (open_module): Don't report filenames for library
        modules in the Dprintf message.

        Prevent possible path buffer overflow in the tcltk init code.
        * tkmain.c (initial_ui_init): Allocate PATH_SIZE instead of
        BUFSIZE to pathbuf.

        Fix so that imfapp always can find imfapp.tcl under Unix by 
        copying the tkconq.tcl finding code. Note: should eventually
        untangle and simplify this spaghetti code. 
        * tkiapp.c (ui_init): Copy library path scanning code from
        initial_ui_init in tkmain.c. Comment out the old code. Also 
        call init_library_path already here.
        (imfapp_main): Don't call init_library_path here.

2004-03-07  Hans Ronne <hronne@comhem.se>

	Fix so that game files can be run from non-standard locations in
	single player games.
	* gif.c (get_gif): Search a sibling images dir first instead of last
	in case we opened the game from a non-standard location.
	* module.c (open_module_saved_game): Search the working dir
	first of all in single player games.
	(open_module_library_file): Search the working dir first of all
	in single player games.
	* mac.c (open_file): Always restore the current volume and 
	directory before returning. Simplify special case code. Remove
	the obsolete "Checkpoint" file name case. 
	(save_game): Save and restore the current volume and directory.
	(game_homedir): Save the current volume and directory and restore
	them as long as we are loading the game. Set the current volume and
	directory to initial_vrefnum and initial_dirid when the mainmodule
	has been loaded so that files are saved in the standard location. 
	* macinit.c (open_game_from_name_and_volume): Don't restore
	the initial current volume and directory after opening a game file 
	from a non-standard location.
	* tkconq.tcl (popup_open_dialog): Set the working directory to 
	the game file location.
	
	Fix so that imfapp also can handle files in non-standard locations.
	* imfapp.tcl (open_imf_dir_cmd): Set the working directory.
	(add_imf_file_cmd): Set the working directory.
	(save_imf_dir_cmd): Set the working directory.
	(save_imf_file_cmd): Set the working directory.
	
2004-03-07  Hans Ronne <hronne@comhem.se>

	Fix display bug in the tcltk interface which caused the connection 
	pen size to spill over into the grid drawing code. Make sure the pen
	size always is set to default for the grid.
	* tkmap.c (draw_terrain_grid): Call XSetLineAttributes in order
	to set the pen size to the default zero value.
	(draw_connections): Add missing test for timg->isconnection in 
	the line drawing cleanup code.

	Fix run warning in the Beirut game due to units that can move
	becoming independent even though indepside->ingame is false.
	* beirut.g (movers): Add possible-sides "locals".
	
	Add Lincoln Peters' new Bolo game variant.
	* bolodd3.g: New game module file.

	Update the pre-release version date.
	* version.h (VERSION): Change to March 2004.

2004-02-15  Hans Ronne <hronne@comhem.se>

	Update the game library. Enable more setup options. Promote
	some working games to release status. Fix a number of game 
	module bugs. Tweak game blurb descriptions.

	* 3rd-age.g (blurb): Tweak text.
	(ng-weird): Use it instead of ng-swedish.
	* 1756.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	(scorekeeper): Change to do last-side-wins.
	(last-turn): Disable. Too short time to play a game.
	* 1757.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* 1805.g (title): Tweak text.
	(blurb): Add period.
	(version): Set to 1.0.	
	(variants): Add world-seen and sequential.
	(instructions): Change text.
	(last-turn): Disable. Too short time to play a game.
	(scorekeeper): Change to do last-side-wins.
	* advances.g (blurb): Tweak text.
	(already-seen): Set to 100 for places.
	(already-seen-independent): Set to 100 for places.
	(see-always): Comment out for places.
	(Aztec Empire): Change to the Aztecs.
	(Maya State): Change to the Mayas.
	* africa-1850.g (title): Tweak text.
	(blurb): Add text.
	(variants): Enable sequential only.
	(instructions): Add text.
	* africa.g (title): Set to Africa.
	(blurb): Tweak text.
	(variants): Enable world-seen, see-all and sequential play.
	(instructions): Add text.
	(sides-min): Don't set.
	(sides-wanted): Set to 4.
	* anc-near-east.g (blurb): Tweak text.
	(variants): Remove people, economy and supply.
	(instructions): Copy from advances.g.
	(indepside-has-ai): Set to false.
	(indepside-can-research): Set to false.
	* ancient-days.g (blurb): Add text.
	(variants): Enable world-seen and sequential play.
	(instructions): Add text.
	(real-time-per-turn): Disable for now.
	(sides-wanted): Set to 4.
	* beirut.g (blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(militia): Change image to trident-riflemen.
	(death-squad): Change image to trident-fanatics.
	(leader): Change image to trident-diplomat.
	(leader): Change name to warlord. Tweak help text.
	(tank): Change image to trident-armor.
	(wreckage): Change image to city20-fire.
	(beach): Change image to adv-desert.
	(street): Change image to flagstone.
	(block): Change image to lime-green.
	(trees): Change image to adv-forest.
	(L): Define as warlord.
	(hp-max): Change to 12 for tanks.
	(self-required): Set to true.
	(can-be-self): Set to true for leader.
	(self-resurrects ): Set to true for leader.
	(occupant-escape-chance): Set to 100.00 for all units.
	(acp-for-retreat): Set to 1 for all units.
	(action-notices):Tweak text.
	(start-with): Give each side 5 warlords and 4 tanks.
	(side-library): Add complete side library for all sides.
	Add missing flags. Add namers for warlords.
	Add adjectives etc. as necessary.
	(maronites): New in-order namer for warlords.
	(amal): New in-order namer for warlords.
	(hezbollah): New in-order namer for warlords.
	(druze): New in-order namer for warlords.
	(syria): New in-order namer for warlords.
	(israel): New in-order namer for warlords.
	(plo): New in-order namer for warlords.
	(sides-max): Change to 7.
	(sides-min): Change to 7.
	(side 0): Set adjective to "empty".
	(instructions): Tweak text. Add line about role of leaders.
	* bolodd2.g (blurb): Add author name.
	(version): Set to 0.1.
	* cave2.g (title): Change to Cave of Amazement.
	(blurb): Tweak text.
	(variants): Add sequential.
	* cave.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* cherbourg.g (blurb): Tweak text.
	(variants): Add world-seen.
	* cil.g (blurb): Add author name.
	(cil-rules): Include it instead of using it as base module
	since it is not playable on its own. 
	* civ2.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(unarmed): Define unarmed units.
	(terrain-density): Increase lush-grassland to 5000.
	(independent-density): Increase village density to 400.
	(independent-density): Double the amount of huts.
	(hit-chance): Add units village 100 (fixed serious bug that 
	caused all offensive units to ignore villages, thus forcing cities 
	to continue building offensive units instead of colonizers if there 
	was a nearby village at the start of the game). Also add unarmed 
	u* 0, thus fixing another bug that forced settlers and engineers 
	to try in vain to attack enemy units.
	(encounter-result ): Tweak text.
	(indepside-has-ai): Set to true so that the Barbarians work 
	the way they are supposed to.
	(side 0): Set name "the Barbarians".
	(side 0): Set adjective "Barbarian".
	* classic.g (version): Change from "obsolete" to 1.0.
	(variants): Add see-all and sequential.
	(synthesis-methods): Add name-geographical-features.
	(feature-types): Define peaks, islands, lakes, bays, seas,
	continents, desert, forest, mountains.
	(feature-namers): Add namers for above features.
	(town-names): Include it.
	(ng-features): Include it.
	* cobra.g (variants): Add world-seen.
	* colonizer (game-module): Don't capitalize.
	(title): Set to "Planet Colonization".
	(version): Set to "0.5".
	(blurb): Add author name.
	(bigicons): Remove obsolete gvar.
	* coral-sea-th.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* coral-sea.g (title): Tweak text.
	(version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(side 3): Set active false.
	* crater-lake.g (version): Change from "obsolete" to 1.0.
	(variants): Add world-seen and sequential.
	* duel.g (blurb): Change text.
	(variants): Add world-seen.
	(side 1): Add name "One".
	(side 2): Add name "Two".
	* dukla.g (title): Add it.
	(blurb): Add it.
	(version): Set to 1.0.
	(variants): Add sequential. Add missing stuff in capture
	the town from pgu.g.
	(synthesis-methods): Enable make-countries only.
	(area): Remove gully patch in impassable terrain.
	* dwellings.imf (village): Change name to village-s at (16 16).
	* empire.g (blurb): Tweak text.
	(variants): Add sequential.
	(version): Set to 0.5.
	(town-names): Include it.
	(capital): Add namer random-town-names.
	(ng-features): Include it.
	(feature-types): Define peaks, islands, lakes, bays, seas,
	continents, mountains.
	(feature-namers): Add namers for above features.
	(sides-min): Set to 2.
	(design-notes): Add note about problems.
	* fantasy.g (variants): Add sequential.
	(desert): Change image-name to adv-desert.
	(plains): Change image-name to adv-plain.
	(forest): Change image-name to adv-forest.
	(hills): Change image-name to adv-hills.
	(mountains): Change image-name to adv-mountains.
	(ice): Change image-name to adv-ice.
	(void): Change image-name to black.
	* feb-1917.g (blurb): Tweak text.
	(variants): Add world-seen and sequential.
	* flags.imf (flag-amal): New image family.
	(flag-druze): New image family.
	(flag-hezbollah): New image family.
	(flag-plo): New image family.
	* flattop.g (burb): Tweak text.
	(variants): Add world-seen and sequential.
	* fred.g (blurb): Tweak text.
	(variants): Add world-seen and sequential. Set see-all to 
	false. Add last-side-wins scorekeeper variant.
	(sides-min): Set to 2.
	(sides-wanted): Set to 4.
	(sides-max): Set to 8.
	(side-library): Add sides from Seven Years War.
	* future.g (blurb): Add period.
	(blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Enable see-all and sequential play.
	(instructions): Copy the beginning of the notes.
	(sides-wanted): Set to 4.
	(namer): Use short-generic-names.
	(features): Add types from standard game.
	(feature-namers): Use standard namers.
	* galaxy2.g (version): Bump to 1.0.
	(blurb): Change text.
	(hit-by): Remove incorrectly used table.
	* galaxy.g (title): Change to Galaxy 1.
	(blurb): Change text.
	(version): Bump to 1.0.
	(variants): Add sequential.
	* game.dir (bolodd2): Add game module.
	(cave2): Add game module.
	(cil): Add game module.
	(colonizer): Add game module.
	(dukla): Add game module.
	(log): Add game module.
	(neurope): Add game module.
	(pgu): Add game module.
	(space-civ): Add game module.
	(spec): Add game module.
	* gazala.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen, see-all and sequential.
	* gettysburg.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add sequential.
	* greek.g (version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Enable sequential. Set last-side-wins to true
	since the game does not work without a scorekeeper.
	(peltast): Change image-name to ancient-spearman.
	(hoplite): Change image-name to ancient-swordman.
	(archer): Change image-name to ancient-archer.
	(cavalry): Change image-name to ancient-cavalry.
	(trireme): Change image-name to ancient-trireme.
	(siege-engine): Change image-name to ancient-ballista.
	(fortifications): Change image-name to walltown.
	(polis): Change image-name to ancient-city.
	(self-required): Set to true.
	(can-be-self): Set to true for metropolis.
	(self-resurrects ): Set to true for metropolis.
	(independent-density): Increase it on plains forest and desert.
	(side-library): Add metropolis namers for each side.	
	(greek-names): New namer with greek city names.
	(greek-island-names): New namer with greek island names.
	(greek-mountain-names): New namer with greek mountain 
	names.
	(metropolis): Add namer greek-names.
	(polis): Add namer greek-names.
	(islands): Define as between 1 and 500 cells.
	(mountains): Define as at least 3 cells.
	(islands): Add feature-namer greek-island-names.
	(mountains): Add feature-namer greek-mountain-names.
	* hill.g (variants): Add world-seen, see-all and sequential.
	(sides-max): Set to 2.
	* imf.dir (city20-fire): List new image family.
	(flag-amal): List new image family.
	(flag-druze): List new image family.
	(flag-hezbollah): List new image family.
	(flag-plo): List new image family.
	* insects.g 	(blurb): Add author name.
	(version): Bump to 1.0.
	(variants): Add sequential.
	(puddle): Set image-name to sea.
	(bare): Set image-name to adv-mountains.
	(grass): Set image-name to civ-grassland.
	(sides-max): Set to 4.
	* intro.g (blurb): Tweak text.
	(instructions): Tweak text.
	(human, robot): Capitalize. Add adjectives.
	* lhs.g (blurb): Change text.
	(version): Set to 1.0.
	(feature-types): Reorder so that bays and peaks are named.
	* log.g (blurb): Add period.
	(feature-types): Reorder so that bays and peaks are named.
	* lord-rings.g (blurb): Change text.
	* magellan.g (blurb): Add period.
	(variants): Add world-seen, see-all and sequential. Add do 
	last-side-wins scorekeeper variant set to false.
	* magnuszew.g (blurb): Add period.
	(variants): Add world-seen and sequential.
	* mars.g (blurb): Tweak text.
	(version): Bump to 1.0.	
	(variants): Add world-seen and sequential.
	* metz-1944.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen.
	* midway.g (version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(side 3): Set active false.
	* monster.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	Add do last-side-wins scorekeeper variant.
	(sides-max): Set to 8 (no more monsters).
	(area 30 30): Define so that the sides can find each other.
	* mormon.g (blurb): Add period.
	(version): Set to 1.0.
	(variants): Define see-all and add sequential.
	(acp-to-build): Fix so that Mormons can make new Mormons.
	(hp-max): Beef up Brigham Young so that he does not always 
	perish on turn 1.
	(hit-chance): Add (places u* 0). Log cabins don't fight.
	* napoleon.g (blurb): Change text.
	(version): Set to 1.0.
	(variants): Add sequential. Set clouds, winds and scoring to 
	true. Change checkbox title to "Last Side Wins". Move point 
	values out of the variant.
	(ldr): Change unit name from leader to marshal.
	(sides-wanted): Set to 6.
	(sides-max): Set to 6.
	(ng-european): Include it.
	(ng-english): Include it.
	(ng-german): Include it.
	(ng-weird): Include it.
	(places): Add namer generic-names.
	(side-library): Add emblems and unit namers for all sides.
	* neurope (title): Add it.
	(blurb): Chnage text.
	(version): Set to 0.1.
	(base-module): Set to classic.
	(variants): Add world-seen and sequential.	
	* normandy.g (title): Change to D-Day.
	(blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Add world-seen. Remove Scoring variant.
	(scorekeeper): Add do last-side-wins.
	* nw-europe.g (title): Change to Operation Overlord.
	(version): Bump to 1.0.
	(blurb): Change text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 2.
	(sides-max): Set to 2.
	* old-empire.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	(ng-features): Include it.
	(feature-types): Define peaks, islands, lakes, bays, seas 
	and continents.
	(feature-namers): Add generic feature namers.
	(city): Add namer generic-names.
	* omaha.g (blurb): Add it.
	(variants): Add world-seen.
	* panzer.g (blurb): Tweak text.
	(variants): Add sequential.
	(swamp): Add image-name flooded.
	(clear): Change image-name to adv-plain.
	(woods): Change image-name to adv-forest.
	(slope): Change image-name to hills.
	(gully): Add image-name swamp.
	* pearl.g (version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(scorekeeper): Add do last-side-wins.
	(last-turn): Comment out.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(side 3): Set active false.
	* pelops.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Enable world-seen and sequential. Remove 
	scorekeeper as a variant.
	(scorekeeper): Add do last-side-wins.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(feature-namers): Set to none (disables naming from 
	base module).
	* pgu.g (title): Change to Panzer General.
	(version): Bump to 1.0.
	(blurb): Change text.
	(variants): Add sequential.
	(airfield): Change image-name to gray.
	* postmodern.g (variants): Add sequential.
	(ng-features): Include it.
	(feature-types): Define the usual set of features.
	(feature-namers): Add namers for all features.
	* quest.g (blurb): Tweak text.
	(variants): Add sequential.
	(ng-features): Include it.
	(feature-types): Define the usual set of features.
	(feature-namers): Add namers for all features.
	(sides-min): Set to 2.
	(sides-max): Set to 2.
	* red-october.g (blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Add sequential.
	(sides): Use noun or plural-noun instead of name.
	* rom-civ-war.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* roman.g (blurb): Tweak text.
	(notes): Tweak text.
	(infantry): Change image to ancient-spearman.
	(cavalry): Change image to ancient-cavalry.
	(archer): Change image to ancient-archer.
	(legion): Change image to ancient-legion.
	(bireme): Change image to ancient-bireme.
	(trireme): Change image to ancient-trireme.
	(barge): Change image to ancient-barge.
	(siege-engine): Change image to ancient-onager.
	(camp): Change image to stockade.
	(tribe): Change image to ancient-tribe.
	(oppidum): Change image to village.
	(civitas): Change image to ancient-city.
	* russian-rev.g (blurb): Add author name.
	(variants): Add sequential.
	(ng-european): Include it.
	(default-namer): Set to random_town_names.
	(places): Use namer russian-place-names.
	* space-civ (title): Capitalize.
	(blurb): Add author.
	(notes): Tweak text.
	(version): Set to 0.5.
	(variants): Add sequential. Set last-side-winds to true.
	* space.g (blurb): Add it.
	(variants): Add world-seen, see-all and sequential.
	* spec-rules (mp-to-enter-terrain): Set to 1 for ferak 
	and royalferak in jungle. Don't set to 1 for these units in 
	forest and deepforest (fixes movement bug).
	* spec (version): Bump to 1.0.
	(blurb): Add author name.
	(base-module): Don't define as spec-rules since it is not 
	playable on its own.
	(instructions): Remove no longer needed file instructions.
	(spec-rules): Include it instead.
	* standard.g (blurb): Add period.
	(feature-types): Reorder so that bays and peaks are named.
	(already-seen): Set to 100 for places.
	(already-seen-independent): Set to 100 for places.
	* standard.imf (city20-fire): Add new image family.
	* steppes.g (blurb): Add period.
	(variants): Enable sequential play.
	* tailhook.g (blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 2.
	(sides-max): Set to 2.
	* tank.g (blurb): Change text.
	(variants): Add sequential. Add do last-side-wins
	scorekeeper variant.
	* time.g (blurb): Add authors.
	(version): Set to 1.0.
	(variants): Add sequential.
	* tokyo.g (variants): Add world-seen and sequential.
	(sides-max): Set to 2 (no more units).
	* u-greek.g (Athens): Put at the top of the list to make 
	self-unit.
	(Sparta): Put at the top of the list to make self-unit.
	(Sardes): Put at the top of the list to make self-unit.
	* u-normandy.g: Remove unused file.
	* voyages.g (blurb): Tweak text.
	(variants): Add sequential. Set winds to true. Add do 
	last-side-wins scorekeeper variant set to true.
	(sides-wanted): Set to 5.
	(sides-max): Set to 5.
	(ng-european): Include it.
	(ng-english): Include it.
	(side-library): Include nation-specific unit namers 
	for places.
	* wizard.g (version): Set to 1.0.
	(blurb): Add period.
	(variants): Att world-seen, see-all and sequential.
	(wagon): Change image-name to trident-settlers.
	(ship): Change image-name to ancient-trireme.
	(grog): Change image-name to heroes-dwarf1.
	(knight): Change image-name to ancient-cavalry.
	(d): Change image-name to monsters-vampire.
	(wizard): Change image-name to heroes-priest1.
	(town): Change image-name to ancient-village1.
	(city): Change image-name to ancient-blue-city.
	(guild): Change image-name to ancient-white-castle.
	(outpost): Change image-name to ancient-tower.
	(ng-features): Include it.
	(ng-weird): Include it.
	(default-namer): Set to short-generic-names.
	(town etc): Add namer short-generic-names.
	(feature-types): Define continents islands seas lakes 
	bays desert forest and mountains.
	(feature-namers): Add generic namers for all features. 
	* ww2-38.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen and sequential.
	(initial-year-part): Set to 12.
	(agreements): Set up alliances anno 1938.
	(scorekeeper): Add do last-alliance-wins.
	* ww2-39.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen and sequential.
	(initial-year-part): Set to 8.
	(agreements): Set up alliances anno 1939.
	(scorekeeper): Add do last-alliance-wins.
	* ww2-42.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen and sequential.
	(initial-year-part): Set to 8.
	(agreements): Set up alliances anno 1942.
	(scorekeeper): Add do last-alliance-wins.
	* ww2-adv (title): Tweak text.
	(blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential. Add 
	do last-alliance-wins scorekeeper variant set to true.
	(unit-size-as-occupants): Set to 10 for ground-types 
	in place-types (20 was too crowded).
	(initial-date): Set to Sep 1939.
	(initial-year-part): Set to 8.
	(sides-max): Set to 10.
	(ng-asian): Include it.
	(ng-european): Include it.
	(ng-english): Include it.
	(ng-german): Include it.
	(ng-american): Include it.
	(ng-chinese): Include it.
	(ng-japanese): Include it.
	(ng-italian): Include it.
	(side-library): Include nation-specific unit namers 
	for places.
	* ww2-bn.g (title): Tweak text.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential. Add do 
	last-side-wins scorekeeper variant set to true.
	(initial-date): Set to 0 1 Jan 1944.
	(sides-max): Set to 2.
	* ww2-div-eur.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Add sequential. Chnage Keep Scores to
	Last Side Wins.
	* ww2-div-pac.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen, see-all, sequential and
	Last Side Wins.
	* ww2-eur-42 (title): Tweak text.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	* ww2s-pac-41.g (title): Tweak text.
	(version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Enable world-seen and sequential play.
	(instructions): Tweak text.
	* ww2s-42.g (title): Tweak text.
	(version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Enable world-seen and sequential play.
	(instructions): Tweak text.
	* ww2s-eur-42.g (title): Tweak text.
	(version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Enable world-seen and sequential play.
	(instructions): Tweak text.
	* ww2-pac-41.g (version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 3.
	(sides-max): Set to 3.

	Add four more flags that are needed in the Beirut game.
	* flags16x16.gif: Add Amal, Druze, Hezbollah and PLO 
	flags. Improve the Jolly Roger.
	* flags8x8.gif: Add Amal, Druze, Hezbollah and PLO 
	flags. Improve the Jolly Roger.
	
	Update the pre-release version date.
	* version.h (VERSION): Change to February 2004.

2004-02-15  Hans Ronne <hronne@comhem.se>

	Fix some minor build problems.
	* plan.c (plan_defense): Remove partially commented 
	out if-else branch that caused parsing problems.
	(plan_random): Rewrite case TASK_HIT_UNIT without
	the empty statement that is disliked by some compilers.
	* conq.h (cmd_error): Move prototype here so that 
	skelconq can find it (this function is never used by
	skelconq, but we keep support for it anyway).
	* ui.h (cmd_error): Move prototype to conq.h.

2004-02-02  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make the 'kwic' program compile with a C++ compiler.
        doc/kwic.c (compare_names): Cast "const void *" to 
        "const char *".

2004-02-02  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add automatic unit type upgrades and the ability to apply 
        additional change-type constraints.
        * doc/refman.texi: Update documentation to reflect new 
        tables and new utype property.
        * actions.c (check_change_type_action): Make more flexible so 
        that it can deal with both doing checks at the start of a turn 
        and during a turn. Add checks involving the new tables.
        * init.c (calculate_globals): Compute a new global flag to see 
        if any types can auto-change-type.
        * kernel.h (any_auto_change_types): New extern global flag.
        * run2.c (run_auto_change_types): New function. If any units 
        can auto-change-type, then iterate through unit list and find 
        out which ones are eligible for promotion, and upgrade them to 
        their new types, if there is room. 
        * table.def (ua_to_change_type): New table. Advance(s) needed to 
        change type.
          (uu_change_type_to): New table. Possible types to change to.
          (uu_cxp_to_change_type): New table. Combat experience needed to 
        change type.
          (uu_occs_to_change_type): New table. Occupants needed to change 
        type.
          (uu_size_to_change_type): New table. Growth needed to change type.
          (uu_turn_to_change_type): New table. Minimum turn required before 
        change type.
        * utype.def (u_auto_upgrade_to): New property. Unit type to 
        automatically upgrade to.

        * aiutil.c: Add additional check to see if the unit can have any 
        supplies at all. If not, then return an approporiate value in all 
        of the recently added materials-related functions.

        * actions.c (check_transfer_action): Remove redundant tests.

        * misc.h (assert_break): Remove extra paramter for messages.
          (assert_continue): Likewise.
          (assert_goto): Likewise.
          (assert_return): Likewise.

        More preparations for more intelligent AI resupply code.
        * task.c (stock_up_materials_for_free): New function. Not compiled.
        Incomplete. Check to see if a unit can swipe any available 
        materials without expending ACP.
          (do_move_to_task): Call 'stock_up_materials_for_free'. Not 
        compiled into code at this point.
        
        Use auto-upgrade mechanism in Bellum. Please see 
        'lib/ChangeLog-bellum' for details.

2004-01-26  Eric McDonald  <mcdonald@phy.cmich.edu>

        Improve victim rating computation and fix some bugs in victim 
        seeking.
        * ai.c (ai_go_after_victim): Captures must be done 1 cell away, 
        not strikedist cells away.
        * plan.c (ai_score_potential_victim_occupants): Do not use 
        precomputed basic worths. Use probabilities from tables instead.
        This prevents negative basic scores from being used, which would 
        throw off the rest of the score calculation.
          (ai_score_potential_victim): Likewise. Also, use a separate 
        'baserating' variable to base rating calculations off of. This 
        prevents 'rating' from ballooning too rapidly in some cases. 
        Add a bonus based on how many types an unit type can build rather 
        than simply whether it can build or not. Add a bonus if the 
        potential victim is worth many more construction points than the 
        victim seeker. Fix bug in the score penalty, which made heavily 
        outclassed victim seekers less penalized than moderately 
        outclassed ones.
          (ai_victim_here): Hoist the occupancy status check above most 
        of the victim seeker logic to make sure that it is always called 
        when it should be. Remove commented out test.
          (ai_consider_capturing): Force a victim seeker consider 
        capturing an enemy self-unit, if that victim seeker is the only kind 
        of unit on its side which could capture the enemy self-unit. Add 
        sanity checks to beginning of function. Simplify capture chance 
        logic.

        Prepare functions for making AI more intelligent wrt resupply.
        (Some of the new functions are near duplicates of existing ones, 
        and this redundancy should be resolved in the near future.)
        (Some of the new functions may be useful at a lower level than the 
        AI, and should perhaps be moved to different files.)
        * aiutil.c (has_enough_of_material): New function. Is a given unit 
        satisfied that is has enough of a given material?
          (needs_n_of_material): New function. How much a given material 
        is needed to satisfy a given unit?
          (has_full_amount_of_material): New function. Does the given unit 
        have the full amount of a given material?
          (wants_n_of_material): New function. How much of a given material 
        is needed to fill a given unit?
          (would_starve_without_material): New function. Would a given unit 
        type starve without a given material?
          (will_starve_wrt_material): New function. Will a given unit starve 
        unless it has some of a given material?
          (can_donate_n_of_material): New function. How much of a given 
        material can a given unit willingly provide?
          (can_sacrifice_n_of_material): New function. How much of a given 
        material can a given unit provide and still survive without acting 
        for one turn?
          (has_enough_of_all_materials): New function. Is a given unit 
        satisfied taht it has enough of all materials?
          (has_full_amount_of_all_materials): New function. Does as given 
        unit have a full amount of all materials?
          (will_starve): New function. Will a given unit starve unless it 
        receives some material?
          (critcally_needed_material): New function. What is the first 
        material needed to prevent starvation?
          (most_needed_material): New function. Which material is most 
        needed by the given unit, and how much of it is needed?
          (most_wanted_material): New function. Which material is most 
        wanted by the given unit, and how much of it is desired?
        * aiutil.h (has_enough_of_material): New prototype.
          (needs_n_of_material): New prototype.
          (has_full_amount_of_material): New prototype.
          (wants_n_of_material): New prototype.
          (would_starve_without_material): New prototype.
          (will_starve_wrt_material): New prototype.
          (can_donate_n_of_material): New prototype.
          (can_sacrifice_n_of_material): New prototype.
          (has_enough_of_all_materials): New prototype.
          (has_full_amount_of_all_materials): New prototype.
          (will_starve): New prototype.
          (critically_needed_material): New prototype.
          (most_needed_material): New prototype.
          (most_wanted_material): New prototype.

        Fix odd movement bug, which would loop infinitely due to a unit 
        attempting to move to its own cell because the next cell was being 
        chosen incorrectly.
        * move.c (do_move_action): Break out of infinite loop if 
        next-cell-is-same-cell weirdness occurs.

        Make the Random plan more intelligent. Just because the plan is 
        random does not mean that its task assignments should be random to 
        the point of lunacy.
        * plan.c (plan_random): Call 'ai_go_after_victim' for the 
        'TASK_CAPTURE' and 'TASK_HIT_UNIT' cases. If that call returns 
        false, put the unit into reserve. Make the 'TASK_MOVE_TO' case 
        check to see if it is using a valid coordinate pair; if not, then 
        put the unit into reserve.

        Cancel a movement task if it is for getting materials that are no 
        longer needed.
        * task.c (do_move_to_task): If next task after the current move-to 
        is a resupply task, then check to see if the resupply indicated 
        by that next task is still needed. Supply lines may have removed 
        the need between turns.

2004-01-19  Eric McDonald  <mcdonald@phy.cmich.edu>

        Improve victim rating computation.
        * ai.c (ai_go_after_victim): Set initial victim_rating to 0 
        rather than INT_MIN. This allows negative ratings to be rejected.
        * aiutil.c (can_be_blocked_by_any_known_enemy_at_if_at): New 
        function. Can be used as predicate with search routines. 
        Performs a check similar to the one used by the movement code, but 
        checks for blocking ZOC's only from known enemy units.
          (can_be_blocked_by_any_known_enemy_if_at): New function. Can be 
        used as a predicate with search routines. For each cell that a 
        unit could hypothetically move to, this searches for potential 
        enemy blockers.
        * aiutil.h (struct a_blocking_zoc_param_box): Structure used for 
        passing parameters in and out of a blocking ZOC search routines. 
        Provides a sleeker, reentrancy-safe alternative to the globals 
        (such as the "victim_*" family and tmpunit) commonly used now.
          (can_be_blocked_by_any_known_enemy_at_if_at): New prototype.
          (can_be_blocked_by_any_known_enemy_if_at): New prototype.
        * conq.h (zoc_range): Transplanted prototype from 'move.c'.
          (unit_blockable_by): Transplanted prototype from 'move.c'.
        * move.c (unit_blockable_by): Remove prototype.
          (zoc_range): Remove prototype.
        * plan.c (ai_score_potential_victim): Add a reciprocal distance 
        penalty, an encounterable victim bonus, self-defense bonus, and 
        victim-with-superior-firepower penalty to computation. Also rewrite 
        the builder-defense bonus not to use a hard-wired constant.
        * task.c (do_move_to_task): If pathfinding is failing and likely 
        due to the presence of a blocking ZOC, and unit is planning to hit 
        or capture something next, then blast the task, and let the planner 
        reconsider what to be done (perhaps hit the blocker). (This is 
        modification is only mildly effective at this point, as the 
        pathfinder usually finds another path which avoids the blockage.)

        Improve performance in non-networked games of Xconq until network 
        sync bug is found and fixed.
        * config.h (USE_LR_PATHING_SOLO): New macro definition.
        * move.c (choose_move_direction): If 'USE_LR_PATHING_SOLO' is set, 
        then wrap cache access code with a check to see that numremotes 
        equals 0 (i.e., a standalone game is being played).
        * path.c (path_get_next_move): Likewise.

        Add some new macro routines for debugging. Will assert if 
        assertions are enabled; otherwise they will output a diagnostic 
        to the user and/or perform a flow control action.
        * misc.h (assert_warning): Warn user if condition test fails.
          (assert_warning_break): Warn user if condition test fails, and 
        then break.
          (assert_warning_continue): Warn user if condition test fails, 
        and then continue.
          (assert_warning_goto): Warn user if condition test fails, and 
        then goto the specified label.
          (assert_warning_return): Warn user if condition test fails, and 
        then return the specified value.
          (assert_error): Give user an error notification if condition test 
        fails, and then abort Xconq.
          (assert_break): Break if condition test fails.
          (assert_continue): Continue if condition test fails.
          (assert_goto): Goto specified label if condition test fails.
          (assert_return): Return specified value if condition test fails.

        Add new search algorithm.
        * world.c (limited_search_under_arc): New function. Searches all the 
        cells in the area from an origin point out to the specified distance, 
        and walled within two adjacent directions. Search may be left-handed 
        or right-handed (in reference to which neighboring direction is used). 
        Search may also be "no-handed", in which case only a radial line 
        segment is searched. Has result limiter. Uses a "parameter box" 
        mechanism instead of common globals. Search performed in depth-first 
        manner.
          (search_under_arc): New function. Wrapper for 
        'limited_search_under_arc' which calls it with an effectively 
        unlimited result limit.
        * world.h (limited_search_under_arc): New prototype.
          (search_under_arc): New prototype.

2004-01-17  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix somewhat latent network sync error introduced by yesterday's 
        patch.
        * ai.c (ai_go_after_victim): Add broadcast flag to parameter 
        list. Use broadcast flag to choose between local and net versions 
        for tasking.
          (offensive_reaction): Call 'ai_go_after_victim' with broadcast 
        flag set to TRUE.
        * plan.c (plan_offense): Call 'ai_go_after_victim' with broadcast 
        flag set to FALSE.
          (plan_defense): Likewise.
          (plan_exploration): Likewise.

2004-01-16  Eric McDonald  <mcdonald@phy.cmich.edu>

        Unify victim finding for capturing, firing, and attacking, and 
        use the victim finder in all places where the previous 
        action-specific victim finders were used. Make victim finder 
        no longer give expedited treatment to capturable and 
        encounterable units. Separate scoring of victims from victim 
        rejection filter. Let victim finder rely on more small evaluator 
        functions rather than retaining so much logic in the main body 
        of the function. (More work still needs to be done to further 
        refine and polish the victim finding, but I would consider this 
        checkin to be an improvement.)
        * ai.c (ai_go_after_victim): No longer static; now global. 
        Comment out old move/attack dispatcher logic. Replace with new 
        logic that accounts for both combat models, prefered capture and 
        hit methods, and prescheduled movement to within striking 
        distance of target. (A few simplifications could be made to 
        this new logic.)
          (average_damage): Rewrite to use new 'dice_roll_mean' function.
          (offensive_worth): Use new 'fire_hit_chance' and 'fire_damage' 
        functions.
          (defensive_worth): Use new 'fire_hit_chance' and 'fire_damage' 
        functions.
          (basic_hit_worth): Make sure that acp-to-attack being zero is 
        only a penalty to acp-dependent units.
          (basic_fire_worth): Make sure that aco-to-fire being zero is 
        only a penalty to acp-dependent units. Use new 'fire_hit_chance' 
        and 'fire_damage' functions.
        * aiutil.c (dice_roll_min): New function. Minimum value from 
        a given integer dice rep.
          (dice_roll_mean): New function. Mean value from a given integer 
        dice rep.
          (dice_roll_max): New function. Maximum value from a given 
        integer dice rep.
          (could_damage_by_fire): Use new 'fire_damage' function.
          (could_capture_any): New function. Could the given type capture 
        any other type?
          (type_attack_damage_max): Use new 'dice_roll_max' function.
          (type_attack_damage_min): Use new 'dice_roll_min' function.
          (type_fire_damage_max): Use new 'dice_roll_max' and 'fire_damage' 
        functions.
          (type_fire_damage_min): Use new 'dice_roll_min' and 'fire_damage' 
        functions.
          (type_fire_range_max): New function. Maximum fire range of one 
        type vs. another.
          (type_hit_range_max): New function. Maximum hit range of one 
        type vs. another.
          (type_ideal_fire_range_max): More cautious logic. Use the greater 
        of hit-falloff-range and range-min.
          (type_possible_damage_methods): Return the various methods that 
        a given type can damage another given type.
          (occ_status): Improved logic. If not see-all but can-see-occupant, 
        then return 'MAYBE_HAS_OCCS' instead of 'DEFINITELY_HAS_NO_OCCS', if 
        no occs seen.
          (n_planning_to_hit_type_at): New function. How many side units are 
        planning to hit a given type at a given position?
          (n_planning_to_capture_type_at): New function. How many side units 
        are planning to capture a given type at a given position?
        * aiutil.h (dice_roll_min): New prototype.
          (dice_roll_mean): New prototype.
          (dice_roll_max): New prototype.
          (could_capture_any): New prototype.
          (type_fire_range_max): New prototype.
          (type_hit_range_max): New prototype.
          (type_possible_damage_methods): New prototype.
          (n_planning_to_hit_type_at): New prototype.
          (n_planning_to_capture_type_at): New prototype.
        * combat.c (fire_hit_chance): New function. Get the value from 
        'fire-hit-chance' or 'hit-chance' as appropriate.
          (fire_damage): New function. Get the value from 'fire-damage' 
        or 'damage' as appropriate.
          (indep_capture_chance): New function. Get the value from 
        'independent-capture-chance' or 'capture-chance' as appropriate.
          (check_fire_at_action): Use new 'fire_hit_chance' function.
          (maybe_hit_unit): Use new 'fire_hit_chance' and 'fire_damage' 
        functions.
          (could_capture_by_attack): New function.
          (could_capture_by_fire): New function.
          (could_capture_by_capture): New function.
          (could_capture): New function.
          (capture_chance): Use new functions 'fire_hit_chance' and 
        'indep_capture_chance'.
          (could_fire_at): Use new function 'fire_hit_chance'.
          (type_can_fire): Use new functions 'fire_hit_chance' and 
        'fire_damage'.
        * config.h (INT_MIN): New macro defining minimum integer size. 
        (This should be handled more dynamically in the future.)
        * conq.h (fire_hit_chance): New prototype.
          (fire_damage): New prototype.
          (indep_capture_chance): New prototype.
          (could_capture_by_attack): New prototype.
          (could_capture_by_fire): New prototype.
          (could_capture_by_capture): New prototype.
          (could_capture): New prototype.
        * plan.c (compute_damage_ratio): Rename to 'ai_damage_ratio_vs_type'.
          (go_after_victim): Disable. 'ai_go_after_victim' now used.
          (ai_score_potential_victim_occupants): New function. Find out 
        how the known occupants of potential victim add to that victim's 
        rating.
          (ai_score_potential_victim): New function. Evaluate how much a 
        victim is worth.
          (ai_choose_best_hit_method): New function. (Still fairly crude.) 
        Evaluate what the best way to hit a target is.
          (ai_consider_capturing): New function. Determine whether an AI 
        should bother attempting capture.
          (ai_consider_shaking): New function. Determine whether an AI 
        should bother roughing up a transport to hurt possible occupants.
          (ai_go_after_vicitm): Declare extern for now. Implementation 
        rests in 'ai.c'. Eventually all of the "ai_*" namespace functions 
        might go there.
          (plan_offense): Call 'ai_go_after_victim' instead of 
        'go_after_victim'. Replace call to 'fire_at_opportunity' with call 
        to 'ai_go_after_victim'.
          (plan_defense): Call 'ai_go_after_victim' instead of 
        'go_after_victim'. Replace calls to 'fire_at_opportunity', 
        'capture_indep_if_nearby', and 'capture_useful_if_nearby' with 
        call to 'ai_go_after_victim'.
          (plan_exploration): Replace calls to 'capture_indep_if_nearby' 
        and 'capture_useful_if_nearby' with call to 'ai_go_after_victim'. 
        Protect call to 'ai_go_after_victim' with anti-flashing logic. 
        Add commented out safeguards to see if provided goals have 
        pathable destinations; pathfinder needs to be improved before 
        turning on these checks; (goal-setter should also be looked at to 
        nip the problem of bad goals in the bud). Fix memory leak in 
        goal blanking logic.
          (ai_victim_here): Partially rewrite to support beforementioned 
        new features of the code.
          (target_here): Unused function. Use new 'fire_damage' function.
          (capture_useful_if_nearby): Unused function. Partially rewrite 
        to more thoroughly accomodate both combat models and ways of 
        capturing units.
        * ui.c (unit_could_attack): Use new 'fire_hit_chance' function.

        * ui.c (impl_move_to): Fix bug that prevented setting destinations 
        into unknown cells.

2004-01-10  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add new files for AI/UI utility functions that return strict, 
        objective answers, but are not used by the referee code.
        * kernel/Makefile.in (ALL_H): Add 'aiutil.h'.
          (OBJS): Add 'aiutil.o'.
          (MW32_OBJS): Add 'aiutil_mw32.o'.
        * kernel/ai.c: Include 'aiutil.h'.
        * kernel/plan.c: Include 'aiutil.h'.
        * kernel/task.c: Include 'aiutil.h'.
        * kernel/aiutil.h: New file.
        * kernel/aiutil.c: New file.

        Start adding more AI-related functions to "ai_" namespace.
        * kernel/ai.c (ai_go_after_victim): Change 'victim_here' call 
        to 'ai_victim_here' call.
          (enemy_close_by): Likewise.
        * kernel/autotest.c (test_victim_here): Likewise.
        * kernel/plan.c (go_after_victim): Likewise. Also rename 
        'victim_here' to 'ai_victim_here'.
        * kernel/conq.h: Rename 'victim_here' to 'ai_victim_here'.

        Include 'assert.h' as a master header instead of in disparate 
        source files.
        * kernel/config.h: Include 'assert.h' here.
        * kernel/ai.c: Do not include 'assert.h' here.
        * kernel/move.c: Likewise.
        * kernel/path.c: Likewise.
        * kernel/task.c: Likewise.

        * kernel/combat.c (could_hit): Rewrite in terms of 'could_attack' 
        and 'could_fire_at'.
          (could_attack): New function with "more correct" logic.
          (could_fire_at): New function with "more correct" logic.
        * kernel/conq.h (could_attack): New prototype.
          (could_fire_at): New prototype.

        Transplant existing AI/UI utility functions and create some new 
        ones.
        * kernel/plan.c (unit_planning_to_hit): Move to 'aiutil.c' and 
        rename to 'planning_to_hit_type_at'.
          (side_planning_to_capture): Move to 'aiutil.c' and rename to 
        'side_planning_to_capture_type_at'.
          (side_planning_to_hit): Move to 'aiutil.c' and rename to 
        'side_planning_to_hit_type_at'.
          (ai_victim_here): Rename calls according to their changed names.
        Also call 'occ_status' instead of duplicating its logic in the 
        function body. Remove anonymous "occupancy status" enum now that 
        OccStatus is declared in 'aiutil.h'. Replace checks for 
        damagability and destructibiliy with call to 'could_destroy'.
          (target_here): Rename 'side_planning_to_capture' call to 
        'side_planning_to_capture_type_at'.
          (compute_damage_ratio): Rename calls according to their changed 
        names. (This function is AI code and should be added to the AI 
        namespace and eventually moved.)
          (type_damage_amount_max): Move to 'aiutil.c' and rename to 
        'type_damage_max'.
        * kernel/aiutil.c (planning_to_hit_type_at): Transplanted from 
        'plan.c'.
          (planning_to_capture_type_at): New function. Logic taken from 
        old 'side_planning_to_capture' function.
          (side_planning_to_hit_type_at): Transplanted from 'plan.c'. 
        Rewritten in terms of 'planning_to_hit_type_at'.
          (side_planning_to_capture_type_at): Transplanted from 'plan.c'. 
        Rewritten in terms of 'planning_to_capture_type_at'.
          (could_damage_by_attack): New function.
          (could_damage_by_fire): New function.
          (could_damage): New function.
          (could_destroy): New function.
          (type_attack_damage_max): New function.
          (type_attack_damage_min): New function.
          (type_fire_damage_max): New function.
          (type_fire_damage_min): New function.
          (type_damage_max): Transplanted from 'plan.c'. Rewritten in terms 
        of 'type_attack_damage_max' and 'type_fire_damage_max'.
          (type_attack_range_max): New function.
          (type_ideal_attack_range_max): New function.
          (type_ideal_fire_range_max): New function.
          (type_ideal_hit_range_max): New function.
          (occ_status): New function. Logic transplanted from 'plan.c'.
        * kernel/aiutil.h: Create prototypes for functions in 'aiutil.c'.

        Help victim finder not choose unreachable victims.
        * kernel/plan.c (ai_victim_here): Calculate a strike distance 
        based on the best ideal range for attacking or firing at a 
        potential victim. If potential victim is outside strike distance, 
        and victim seeker is mobile, then see if victim seeker can get 
        within the strike distance of the potential victim.

2004-01-05  Hans Ronne <hronne@comhem.se>

	Add pre-flight command checking for move and move-to
	commands in all interfaces that tests if a path exists to
	the intended destination. 
	* history.def (A_MOVE_NO_PATH): New HistEventType.
	* nlang.c (advance_failure_desc): Return empty string
	if reason was A_MOVE_NO_PATH.
	* ui.h (impl_move_to): Prototype extern.
	* ui.c (impl_move_to): New function.
	(advance_into_cell): Call impl_move_to instead of
	net_set_move_to_task. Check the result and set reason 
	to A_MOVE_NO_PATH if we failed. Provide notification
	feedback when a unit is unable to move because it lacks
	acps.
	* ccmd.c (do_move_to): Call impl_move_to instead 
	of net_set_move_to_task or net_designer_teleport. 
	Return cmd_error for non-mobile units unless 
	is_designer(side).
	* maccmd.c (do_one_move_to): Call impl_move_to
	instead of net_set_move_to_task or net_designer_teleport.
	Set map_modal to NO_MODAL when done. Return cmd_error
	for non-mobile units unless is_designer(dside).
	* tkcmd.c (do_move_to): Return cmd_error for 
	non-mobile units unless is_designer(side). 
	(aux_move_to): Call impl_move_to instead of 
	net_set_move_to_task or net_designer_teleport. Set 
	modalhandler to aux_move_to if impl_move_to fails.
	* tkmap.c (move_the_selected_unit): Check that failbuf
	is non-empty before using it.
	* sdlcmd.c (do_move_to): Return cmd_error for 
	non-mobile units unless is_designer(side). 
	(aux_move_to): Call impl_move_to instead of 
	net_set_move_to_task or net_designer_teleport. Set 
	modalhandler to aux_move_to if impl_move_to fails.
	* xcmd.c (do_move_to): Return cmd_error for 
	non-mobile units unless is_designer(side). 
	(aux_move_to): Call impl_move_to instead of 
	net_set_move_to_task or net_designer_teleport. Set 
	modalhandler to aux_move_to if impl_move_to fails.

	Fix various problems with the new pre-flight command 
	checking for the build code.
	* ui.c (impl_build): Add message that tells the user to 
	try once again if the selected location was no good.
	* unit.c (side_could_put_type_at): New function.
	(unit_can_build_type_at): Check for incomplete units in
	the same cell and don't require extra space for creating a
	new unit in that case. Add notification messages that tell
	the player to pick a new location if we fail.
	* ccmd.c (do_build): Replace commented out cmd_error
	with working version from tkcmd.c. Improve notification 
	messages.
	* macunit.c (update_build_menu): Add any incomplete
	units that we may build on even if there is no space for
	new units.
	* tkcmd.c (do_build): Improve notification messages.
	(aux_build): Rearrange so that the Escape key works 
	again. Improve notification messages.
	(aux_build_2): Rearrange so that the Escape key works 
	again. Improve and add notification messages.
	(aux_change_type): Improve notification messsage.
	* sdlcmd.c (aux_build): Rearrange so that the Escape 
	key works again. Improve notification messages.
	(aux_build_2): Rearrange so that the Escape key works 
	again. Improve and add notification messages.
	(aux_change_type): Improve notification messsage.
	* xcmd.c (do_build): Don't test for numtypes in the
	cmd_error code. Improve notification messsage.
	(aux_build): Improve notification messages.
	(aux_change_type): Improve notification messsage.
	
	Add a side->cancarry vector to speed up path-finding
	that involves transports.
	* actions.c (make_unit_complete): Make a call to
	update_cancarry_vector for transports.
	* conq.h (update_cancarry_vector): Prototype extern.
	* init.c (calculate_globals): Call update_cancarry_vector.
	* run.c (update_cancarry_vector): New function.
	* side.c (create_side): Allocate side->cancarry vector.
	* side.h (a_side): Add side->cancarry vector.
	(side_can_carry): New macro.
	* unit.c (change_unit_type): Call update_cancarry_vector.
	(change_unit_side): Call update_cancarry_vector.
	* unit.h (side_could_put_type_at): Prototype.

	Make direct_access_to available to the kernel.
	* kernel.h (direct_access_to): Prototype here.
	* plan.c (direct_access_to): Remove prototype.
	* task.c (direct_access_to): Remove prototype.
	
	Remove hack in the tcltk interface that forces the unit to
	build on an incomplete transport even if the player wants
	it to do something else.
	* tkcmd.c (do_build): Remove net_resume_build_task
	call in the default case.

	Fix so that the Escape key works in the command line of 
	the Mac tcltk interface.
	* tkmain.c (tk_interp_key): Add code that checks argv[3]
	for "Escape" and set inpch to ESCAPE_CHAR in that case.
	* tkconq.tcl (make_normal_bindings): Add key binding
	for "%K" == "Escape".

2004-01-04  Jim Kingdon  <kingdon@panix.com>

	* curses/ccmd.c (cmd_error): Call vsnprintf not vsprintf.
	* kernel/skelconq.c (cmd_error): Add this function.

2004-01-04  Hans Ronne <hronne@comhem.se>

	Fix so that the curses interface does not choke on games
	like Bellum that generate messages during run_turn_start.
	* cdraw.c (show_cursor): Return if we lack curunit.

	Add change-type handling code to the Mac PPC interface 
	and enable Eric's code for the other interfaces.
	* cmd.def (do_change_type): Enable command.
	* maccmd.c (do_change_type): New function.
	* macdefs.h (miPlayChangeType): New menu item. 
	Reorder existing menu items.
	(mChangeTypePopup): New menu.
	(dChangeType): New dialog and items.
	* macconq.h (changetypewin): Declare extern WindowPtr.
	(changetypewin_unit): Declare extern unit.
	(show_change_type_dialog): Prototype extern.
	(draw_change_type_dialog): Prototype extern.
	(do_mouse_down_change_type): Prototype extern.
	(do_key_down_change_type): Prototype extern.
	* macconq.c (do_mouse_down): Handle changetypewin.
	(handle_keystroke): Handle changetypewin.
	(update_window): Handle changetypewin.
	(update_unit_acp_display): Update changetypewin.
	* macmenus.c (do_menu_command): Add miPlayChangeType.
	(adjust_menus): Handle miPlayChangeType.
	(enable_commands_for_unit): Handle miPlayChangeType.
	* macunit.c (buildwin_unit): Initialize to NULL.
	(changetypewin_unit): Initialize to NULL.
	(changetypewin): Initialize to NULL.
	(changetype_dlg): Initialize to NULL.
	(show_change_type_dialog): New function.
	(draw_change_type_dialog): New function.
	(do_mouse_down_change_type): New function.
	(do_key_down_change_type): New function.
	(hit_change_type_dialog): New function and prototype.
	(update_change_type_menu): New function and prototype.
	* tkconq.tcl (create_map_menus): Enable Change Type
	command in the Play menu.
	(adjust_play_menu): Enable Change Type adjustment.
	* Xconq.r (CNTL 721 "Change Type Popup): New control.
	(dctb 813 "Change Type"): New dialog color table.
	(DITL 813 "Change Type"): New dialog item list.
	(DLOG 813 "Change Type"): New dialog resource.
	(MENU 132 "Play"): Add Change Type menu item.
	(MENU 721 "Change Type Popup"): New popup menu.
	
	Improve notification feedback and history event message
	code for change type actions.
	* history.def (H_UNIT_TYPE_CHANGED): Pass the new
	unit type as third argument.
	* nlang.c (historical_event_desc): Handle case
	H_UNIT_TYPE_CHANGED.
	* ui.c (impl_build): Fix some comment typos.
	(impl_change_type): Add notification feedback for 
	successful action. Tweak the other messages and add
	 the unit type name.
	 * unit.c (change_unit_type): Pass newtype as third
	 argument in the call to record_event.
	
	Fix minor bug in the Mac PPC unit build popup.
	* macunit.c (draw_unit_build_dialog): Remove 
	redundant call to GetDItem.

	Fix to unit selection in the Mac PPC interface.
	* maccmd.c (get_selected_units): Check that the selected unit
	is in_play and that side_controls_unit is true also for units
	that are selected from a list. Note: this check is redundant since
	apply_to_all_selected checks the same thing again, but we do
	it anyway for consistency and in case get_selected_units is 
	used in some other way in the future.
	(get_one_selected_unit): New function and prototype.

2004-01-02  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix very serious movement bug that prevented units from legally 
        disembarking from a transport as part of movement. Thanks to 
        Jim Kingdon and Brian Dunn who reported this bug.
        * move.c (pathable_point): Add a special test to make sure that 
        proper ferry costs are used when leaving a transport. (This still 
        may not be quite correct because we should check the ferry entry 
        costs of another ferry we might be boarding on the first step 
        of the journey.)

        Try to speed up the pathing a little.
        * move.c (pathable_point): Try to optimize the logic in the 
        side_unit_list iterator when looking for suitable transports.
        * path.c (path_get_next_move): Keep nodelist_verify calls out 
        of the most active flow.

2004-01-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make CVS ignore alternately named executables and clutter in 
        the kernel directory.
        * curses/.cvsignore: Ignore 'xconq' and 'xconq.exe'.
        * kernel/.cvsignore: Ignore 'Xconq.Warnings' from 'skelconq'.
        * sdl/.cvsignore: Ignore 'sdlconq' and 'sdlconq.exe'.
        * tcltk/.cvsignore: Ignore 'tkconq' and 'tkconq.exe'.

2004-01-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        The new year comes amain in the US Mountain timezone. Just 
        a few more minutes....
        Happy New Year from Boulder, CO, USA!

        Add disabled (but tested) support for the "change-type" 
        mechanism in the Curses, Xt/Xaw, SDL, and Tcl/Tk interfaces.
        To be enabled once the Mac interface supports change-type.
        * kernel/cmd.def (c): Fill out change-type command information 
        for 'c' key binding. Leave commented out. Must uncomment to 
        enable change-type.
        * curses/ccmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (This has not been tested 
        because Cconq presently chokes on Bellum, the test case.)
        * kernel/ui.c (impl_change_type): New function. Common code 
        shared by all the interfaces. This interacts with the 
        change-type machinery in the kernel.
        * kernel/ui.h (impl_change_type): New prototype.
        * lib/u-bellum.g (material-to-change-type): Hacked for testing.
        * lib/uu-bellum.g (acp-to-change-type): Hacked for testing.
        * sdl/sdlcmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (Fully tested.)
          (aux_change_type): New prototype and function. Provide extended 
        user interaction for change-type.
        * tcltk/tkcmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (Fully tested.)
          (aux_change_type): New prototype and function. Provide extended 
        user interaction for change-type.
        * tcltk/tkconq.tcl: Add "Change Type" to "Play" menu and make 
        sure that it gets updated. Commented out for now. (Remember to 
        uncomment when activating change-type in Xconq.)
        * tcltk/tkinit.c (update_action_controls_info): Make sure that 
        the "Change Type" info flag is properly udpated.
        * x11/xcmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (Fully tested.)
          (aux_change_type): New prototype and function. Provide extended 
        user interaction for change-type. (Fully tested.)

2004-01-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        Splice in entries that were missed during log separation.
        * ChangeLog-2003: Reinsert missed entries from between 12-28 
        and 12-30.

2004-01-01  Hans Ronne <hronne@comhem.se>

	Update the pre-release version date.
	* version.h (VERSION): Change to January 2004.

	Split the ChangeLog file.
	* ChangeLog: Move old content to ChangeLog-2003.
	* ChangeLog-2003: New file.
