Commit graph

28 commits

Author SHA1 Message Date
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
d012940230 Simplify routech[]
routech[][1] hasn't been used in living memory.  Drop it, and simplify
to routech[].
2008-08-27 21:30:56 -04:00
1ac95e0ed7 Fix recently introduced memory corrupter in path()
path() failed to normalize coordinate argument for deltx() and
delty().  This could subscript map[] and mapbuf[] out of bounds.
Broken in commit 3ca88271.
2008-08-26 21:42:32 -04:00
3ca882714d Fix computation of map buffer indexes
The correct method to compute indexes into a map buffer for a struct
range is deltx(), delty().

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

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

draw_map() used xnorm(), ynorm() instead, which is correct, but less
clear and less efficient.
2008-08-19 08:54:04 -04:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
Ron Koenderink
94cf6d1ad8 (path): Fix to print every step of the path not every second step of the path.
Broken in rev. 1.10.
2007-11-17 17:05:48 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
20c02295a6 (BestDistPath): All callers pass MOB_ROAD to parameter mob_type,
remove it.  Callers changed.
2006-06-04 16:49:24 +00:00
0a3a73cf3d Recent s_char purge changed element types to s_char *, but missed
patterns malloc(N * sizeof(s_char *)), fix.
2006-04-29 16:14:48 +00:00
a988b907fc s_char purge directed by compiler warnings. 2006-04-29 06:41:45 +00:00
bd2673a6e4 Remove superflous casts. 2006-03-28 19:51:48 +00:00
8cd3845b08 Remove useless multiplications with sizeof(char) and sizeof(s_char).
Replace by literal 1 in other contexts.
2006-03-26 10:16:08 +00:00
21bf6b41d4 Use NULL instead of (FOO *)0, it's easier to read. 2006-03-23 20:48:49 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
dfa56cb0ef (diridx): New. Use instead of chkdir() where direction characters
must be valid.  Oopses on bad direction characters.
(pathtoxy, ac_encounter): Bad direction characters used to lead to bad
array subscript and potential disaster.
(pathrange, path): Stop on DIR_STOP as well as on bad direction
characters.  This is just for consistency with other code; DIR_STOP
should occur only last in a path here.
(sail_nav_fleet, nav_ship): No change except for the oops.
2005-09-25 09:49:36 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
46da1aec7a deity.h is redundant, remove it. 2004-02-20 20:34:43 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
4ae9c417b3 (bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect.  Replace calls by struct assignment where possible.  Replace
clear buffer, copy string to buffer by strncpy().  Use assignment to
clear when that's clearer.  Replace overlapping copy through bounce
buffer by memmove().  Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.
2004-01-08 17:54:28 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00