From 47ead24f98cc789e6ae0aab064979978f03bd97b Mon Sep 17 00:00:00 2001 From: stpohle Date: Mon, 5 May 2003 16:33:57 +0000 Subject: [PATCH] field generation fix --- src/basic.h | 4 ++-- src/field.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/basic.h b/src/basic.h index c7f1f57..b10d714 100644 --- a/src/basic.h +++ b/src/basic.h @@ -24,8 +24,8 @@ #define MAX_GAMESRVENTRYS 255 /* number of entry which can be get */ #define MAX_FIELDSIZE_X 51 #define MAX_FIELDSIZE_Y 31 -#define MIN_FIELDSIZE_X 21 -#define MIN_FIELDSIZE_Y 13 +#define MIN_FIELDSIZE_X 15 +#define MIN_FIELDSIZE_Y 9 #define ANI_FIRETIMEOUT 20 diff --git a/src/field.c b/src/field.c index aebb883..ef2169a 100644 --- a/src/field.c +++ b/src/field.c @@ -1,4 +1,4 @@ -/* $Id: field.c,v 1.9 2003/05/05 15:53:27 stpohle Exp $ */ +/* $Id: field.c,v 1.10 2003/05/05 16:33:57 stpohle Exp $ */ /* field.c - procedures which are needed to control the field */ #include @@ -283,6 +283,12 @@ field_new (char *filename) // Clean and create the field // if (fmap == NULL) { + /* if we can't load the map check first the fieldsize settings */ + if (bman.fieldsize.x < MIN_FIELDSIZE_X) + bman.fieldsize.x = MIN_FIELDSIZE_X; + if (bman.fieldsize.x > MAX_FIELDSIZE_X) + bman.fieldsize.x = MAX_FIELDSIZE_X; + for (x = 0; x < bman.fieldsize.x; x++) for (y = 0; y < bman.fieldsize.y; y++) { if ((y == 0) || (y == bman.fieldsize.y - 1))