- Logging an error when a ship is moved to an illegal coast.

- Removing a const-cast warning from call to translate()
This commit is contained in:
Enno Rehling 2004-09-05 09:51:57 +00:00
parent 3b329d952f
commit fa0114b64c
3 changed files with 14 additions and 2 deletions

View File

@ -45,6 +45,7 @@
/* util includes */ /* util includes */
#include <util/goodies.h> #include <util/goodies.h>
#include <util/base36.h>
#include <util/language.h> #include <util/language.h>
#include <util/rand.h> #include <util/rand.h>
@ -550,6 +551,17 @@ move_ship(ship * sh, region * from, region * to, region_list * route)
} }
if (*iunit==u) iunit=&u->next; if (*iunit==u) iunit=&u->next;
} }
#ifndef NDEBUG
if (rterrain(sh->region)!=T_OCEAN) {
region * rcoast = rconnect(sh->region, sh->coast);
if (rterrain(rcoast)!=T_OCEAN) {
log_error(("ship %s sailed into a coast with no ocean neighbours.\n",
shipid(sh)));
}
}
#endif
return sh; return sh;
} }

View File

@ -335,7 +335,7 @@ parse(opstack ** stack, const char* inn, const void * userdata)
} }
const char * const char *
translate(const char* format, const void * userdata, const char* vars, const void* args[]) translate(const char* format, const void * userdata, const char* vars, void* args[])
{ {
int i = 0; int i = 0;
const char *ic = vars; const char *ic = vars;

View File

@ -25,7 +25,7 @@ extern void opstack_push(struct opstack ** stack, void * data);
extern void translation_init(void); extern void translation_init(void);
extern void translation_done(void); extern void translation_done(void);
extern const char * translate_va(const char* format, const void * userdata, const char* vars, ...); extern const char * translate_va(const char* format, const void * userdata, const char* vars, ...);
extern const char * translate(const char* format, const void * userdata, const char* vars, const void* args[]); extern const char * translate(const char* format, const void * userdata, const char* vars, void* args[]);
/* eval_x functions */ /* eval_x functions */
typedef void (*evalfun)(struct opstack ** stack, const void *); typedef void (*evalfun)(struct opstack ** stack, const void *);