diff -urN xpilot-4.5.4/src/common/commonproto.h xpilot-4.5.4-fix2/src/common/commonproto.h --- xpilot-4.5.4/src/common/commonproto.h 2001-06-03 00:02:05.000000000 +0300 +++ xpilot-4.5.4-fix2/src/common/commonproto.h 2003-09-12 23:17:08.000000000 +0300 @@ -36,7 +36,7 @@ extern unsigned int randomMT(void); /* math.c */ -extern DFLOAT rfrac(void); +extern double rfrac(void); extern int mod(int x, int y); extern void Make_table(void); diff -urN xpilot-4.5.4/src/common/draw.h xpilot-4.5.4-fix2/src/common/draw.h --- xpilot-4.5.4/src/common/draw.h 2002-06-15 21:08:42.000000000 +0300 +++ xpilot-4.5.4-fix2/src/common/draw.h 2003-09-12 23:17:08.000000000 +0300 @@ -130,8 +130,6 @@ unsigned shape_version); void Rotate_point(position pt[RES]); -extern DFLOAT rfrac(void); - extern int mod(int x, int y); #endif diff -urN xpilot-4.5.4/src/common/math.c xpilot-4.5.4-fix2/src/common/math.c --- xpilot-4.5.4/src/common/math.c 2001-05-08 14:35:29.000000000 +0300 +++ xpilot-4.5.4-fix2/src/common/math.c 2003-09-12 23:17:08.000000000 +0300 @@ -96,13 +96,13 @@ } -DFLOAT rfrac(void) +double rfrac(void) { /* * Return a pseudo-random value in the range { 0.0 <= x < 1.0 }. * Use randomMT() which returns a 32 bit PRN and multiply by 1/(1<<32). */ - return (DFLOAT)((double) randomMT() * 0.00000000023283064365386962890625); + return (double) randomMT() * 0.00000000023283064365386962890625; } diff -urN xpilot-4.5.4/src/server/asteroid.c xpilot-4.5.4-fix2/src/server/asteroid.c --- xpilot-4.5.4/src/server/asteroid.c 2002-01-25 23:21:36.000000000 +0200 +++ xpilot-4.5.4-fix2/src/server/asteroid.c 2003-09-13 01:32:53.000000000 +0300 @@ -44,6 +44,7 @@ #include "bit.h" #include "objpos.h" #include "asteroid.h" +#include "commonproto.h" char asteroid_version[] = VERSION; @@ -391,8 +392,8 @@ if (px > World.width) px -= World.width; if (py > World.height) py -= World.height; } - if (px < 0 || px > World.width - || py < 0 || py > World.height) { + if (px < 0 || px >= World.width + || py < 0 || py >= World.height) { continue; } } else { diff -urN xpilot-4.5.4/src/server/collision.c xpilot-4.5.4-fix2/src/server/collision.c --- xpilot-4.5.4/src/server/collision.c 2002-04-21 23:31:31.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/collision.c 2003-09-13 01:33:53.000000000 +0300 @@ -642,7 +642,7 @@ else if (selfImmunity) { continue; } - } else if (teamImmunity && + } else if (selfImmunity && IS_TANK_PTR(pl) && (pl->lock.pl_id == obj->id)) { continue; diff -urN xpilot-4.5.4/src/server/command.c xpilot-4.5.4-fix2/src/server/command.c --- xpilot-4.5.4/src/server/command.c 2002-06-08 16:39:44.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/command.c 2003-09-13 01:29:14.000000000 +0300 @@ -462,7 +462,7 @@ AllyAccept = 3, AllyLeave = 4, AllyList = 5, - NumAllyCmds = 6, + NumAllyCmds = 6 }; int i, cmd; @@ -830,6 +830,12 @@ case -2: sprintf(msg, "No option named %s.", arg); break; + case -3: + sprintf(msg, "Cannot show the value of this option."); + break; + case -4: + sprintf(msg, "No value has been set for option %s.", arg); + break; default: strcpy(msg, "Generic error."); break; diff -urN xpilot-4.5.4/src/server/defaults.h xpilot-4.5.4-fix2/src/server/defaults.h --- xpilot-4.5.4/src/server/defaults.h 2001-11-30 13:47:19.000000000 +0200 +++ xpilot-4.5.4-fix2/src/server/defaults.h 2003-09-13 01:29:05.000000000 +0300 @@ -34,7 +34,7 @@ valString, /* variable is type char* */ valSec, /* variable is type int (converted to frames) */ valPerSec, /* variable is type float (converted to per-frame) */ - valList, /* variable is a list of elements of type char* */ + valList /* variable is a list of elements of type char* */ }; @@ -46,7 +46,7 @@ OPT_MAP = 1, OPT_DEFAULTS = 2, OPT_COMMAND = 4, - OPT_PASSWORD = 8, + OPT_PASSWORD = 8 }; typedef enum _optOrigin optOrigin; @@ -57,7 +57,7 @@ enum _optOriginAny { OPT_NONE = 0, /* not settable */ OPT_ORIGIN_ANY = 7, /* allow any of {map,defaults,command} */ - OPT_VISIBLE = 16, /* can we query this option value? */ + OPT_VISIBLE = 16 /* can we query this option value? */ }; diff -urN xpilot-4.5.4/src/server/item.c xpilot-4.5.4-fix2/src/server/item.c --- xpilot-4.5.4/src/server/item.c 2002-04-13 21:26:03.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/item.c 2003-09-13 01:29:33.000000000 +0300 @@ -48,6 +48,7 @@ #include "netserver.h" #include "error.h" #include "objpos.h" +#include "commonproto.h" char item_version[] = VERSION; diff -urN xpilot-4.5.4/src/server/laser.c xpilot-4.5.4-fix2/src/server/laser.c --- xpilot-4.5.4/src/server/laser.c 2002-05-01 19:33:25.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/laser.c 2003-09-13 01:33:11.000000000 +0300 @@ -47,7 +47,7 @@ #include "portability.h" #include "objpos.h" #include "asteroid.h" - +#include "commonproto.h" char laser_version[] = VERSION; @@ -406,7 +406,7 @@ dx = midx - ast->pos.x; dy = midy - ast->pos.y; dx = WRAP_DX(dx); - dy = WRAP_DX(dy); + dy = WRAP_DY(dy); range = ast->pl_radius + pulse->len / 2; if (sqr(dx) + sqr(dy) < sqr(range)) { List_push_back(output_obj_list, ast); @@ -609,7 +609,7 @@ adx = x - ast->pos.x; ady = y - ast->pos.y; adx = WRAP_DX(adx); - ady = WRAP_DX(ady); + ady = WRAP_DY(ady); if (sqr(adx) + sqr(ady) <= sqr(ast->pl_radius)) { obj->life = 0; ast->life += ASTEROID_FUEL_HIT(ED_LASER_HIT, diff -urN xpilot-4.5.4/src/server/parser.c xpilot-4.5.4-fix2/src/server/parser.c --- xpilot-4.5.4/src/server/parser.c 2001-11-30 13:47:19.000000000 +0200 +++ xpilot-4.5.4-fix2/src/server/parser.c 2003-09-12 23:17:08.000000000 +0300 @@ -573,6 +573,9 @@ return -2; /* Variable not found */ } + if ((opt->flags & OPT_VISIBLE) == 0) + return -3; + switch (opt->type) { case valInt: sprintf(value, "%d", *((int *)opt->variable)); @@ -584,6 +587,8 @@ sprintf(value, "%s", *((bool *)opt->variable) ? "true" : "false"); break; case valString: + if (*((char **)opt->variable) == NULL) + return -4; strlcpy(value, *((char **)opt->variable), size); break; case valSec: diff -urN xpilot-4.5.4/src/server/play.c xpilot-4.5.4-fix2/src/server/play.c --- xpilot-4.5.4/src/server/play.c 2001-12-11 14:45:13.000000000 +0200 +++ xpilot-4.5.4-fix2/src/server/play.c 2003-09-13 01:29:58.000000000 +0300 @@ -41,6 +41,7 @@ #include "saudio.h" #include "score.h" #include "objpos.h" +#include "commonproto.h" char play_version[] = VERSION; diff -urN xpilot-4.5.4/src/server/player.c xpilot-4.5.4-fix2/src/server/player.c --- xpilot-4.5.4/src/server/player.c 2002-04-21 22:08:15.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/player.c 2003-09-13 01:30:12.000000000 +0300 @@ -46,6 +46,7 @@ #include "error.h" #include "objpos.h" #include "draw.h" +#include "commonproto.h" char player_version[] = VERSION; diff -urN xpilot-4.5.4/src/server/proto.h xpilot-4.5.4-fix2/src/server/proto.h --- xpilot-4.5.4/src/server/proto.h 2002-04-13 21:26:04.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/proto.h 2003-09-12 23:17:08.000000000 +0300 @@ -109,7 +109,6 @@ int mod(int x, int y); int f2i(DFLOAT f); DFLOAT findDir(DFLOAT x, DFLOAT y); -DFLOAT rfrac(void); void Make_table(void); diff -urN xpilot-4.5.4/src/server/update.c xpilot-4.5.4-fix2/src/server/update.c --- xpilot-4.5.4/src/server/update.c 2002-06-11 06:59:39.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/update.c 2003-09-13 01:34:54.000000000 +0300 @@ -1138,8 +1138,8 @@ } } if (!counter) { - w.x = OBJ_X_IN_BLOCKS(pl); - w.y = OBJ_Y_IN_BLOCKS(pl); + w.x = OBJ_X_IN_PIXELS(pl); + w.y = OBJ_Y_IN_PIXELS(pl); } if (counter && wormTime diff -urN xpilot-4.5.4/src/server/walls.c xpilot-4.5.4-fix2/src/server/walls.c --- xpilot-4.5.4/src/server/walls.c 2002-04-21 12:31:18.000000000 +0300 +++ xpilot-4.5.4-fix2/src/server/walls.c 2003-09-13 01:30:27.000000000 +0300 @@ -46,6 +46,7 @@ #include "walls.h" #include "click.h" #include "objpos.h" +#include "commonproto.h" char walls_version[] = VERSION;