crwritemap has been exported to lua as write_map(filename).

This commit is contained in:
Enno Rehling 2005-07-26 10:50:00 +00:00
parent 8e2225e4d5
commit e4bdec8e7c
5 changed files with 20 additions and 30 deletions

View File

@ -1535,3 +1535,18 @@ report_computer(FILE * F, faction * f, struct seen_region ** seen, const faction
} }
return 0; return 0;
} }
int
crwritemap(const char * filename)
{
FILE * F = fopen(filename, "w+");
region * r;
for (r=regions;r;r=r->next) {
plane * p = rplane(r);
fprintf(F, "REGION %d %d %d\n", r->x, r->y, p?p->id:0);
fprintf(F, "\"%s\";Name\n\"%s\";Terrain\n", rname(r, default_locale), LOC(default_locale, terrain[rterrain(r)].name));
}
fclose(F);
return 0;
}

View File

@ -28,6 +28,8 @@ extern void creport_init(void);
extern void report_init(void); extern void report_init(void);
extern void report_cleanup(void); extern void report_cleanup(void);
extern int crwritemap(const char * filename);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -10,6 +10,7 @@
// gamecode includes // gamecode includes
#include <gamecode/laws.h> #include <gamecode/laws.h>
#include <gamecode/monster.h> #include <gamecode/monster.h>
#include <gamecode/creport.h>
// kernel includes // kernel includes
#include <kernel/alliance.h> #include <kernel/alliance.h>
@ -214,6 +215,7 @@ bind_eressea(lua_State * L)
def("atoi36", &atoi36), def("atoi36", &atoi36),
def("itoa36", &itoa36), def("itoa36", &itoa36),
def("read_game", &read_game), def("read_game", &read_game),
def("write_map", &crwritemap),
def("write_game", &write_game), def("write_game", &write_game),
def("write_passwords", &writepasswd), def("write_passwords", &writepasswd),
def("init_reports", &init_reports), def("init_reports", &init_reports),

View File

@ -143,20 +143,6 @@ struct settings global = {
1000, /* maxunits */ 1000, /* maxunits */
}; };
static int
crwritemap(void)
{
FILE * F = fopen("world.cr", "w+");
region * r;
for (r=regions;r;r=r->next) {
plane * p = rplane(r);
fprintf(F, "REGION %d %d %d\n", r->x, r->y, p?p->id:0);
fprintf(F, "\"%s\";Name\n\"%s\";Terrain\n", rname(r, default_locale), LOC(default_locale, terrain[rterrain(r)].name));
}
fclose(F);
return 0;
}
static void static void
game_init(void) game_init(void)
{ {
@ -651,7 +637,7 @@ main(int argc, char *argv[])
} }
if (g_writemap) { if (g_writemap) {
return crwritemap(); return crwritemap("world.cr");
} }
if (turn == 0) srand((int)time(0)); if (turn == 0) srand((int)time(0));

View File

@ -1,28 +1,15 @@
TODO: TODO:
parteien- oder gruppenweises aftermath-markieren.
XUL for Eressea XUL for Eressea
weights in item descriptions
[11:01] <Enno`> am besten wäre, wenn mailit nur die optionen, nicht das ganze script enthielte [11:01] <Enno`> am besten wäre, wenn mailit nur die optionen, nicht das ganze script enthielte
[11:01] <Enno`> und ein skript dann mailit als input nähme [11:01] <Enno`> und ein skript dann mailit als input nähme
[11:02] <Enno`> also nur enno@eressea.upb.de pka3 BZIP2 nr cr zv [11:02] <Enno`> also nur enno@eressea.upb.de pka3 BZIP2 nr cr zv
Deathcloud: Magieresistenz des Magiers in das attribut, nicht auflösen wenn magier tot. Deathcloud: Magieresistenz des Magiers in das attribut, nicht auflösen wenn magier tot.
Messungen:
Messen, was CR alleine kostet.
Messen, was no-ZV bringt. Zugvorlage abstellen.
Conan:
Auswertung 0:30 h
Verpacken: 1:35 h
error handling in lua/luabind? error handling in lua/luabind?
mapper: parteien sofort aussetzen.
english registration confirmation is deutsch! english registration confirmation is deutsch!
NO_RUNNING NO_RUNNING
@ -43,8 +30,6 @@ getstrtoken() - das static loswerden
R_PERSON fix in vin2? R_PERSON fix in vin2?
calendar in XML
unterschiede in vin3 + wdw per config statt defines? unterschiede in vin3 + wdw per config statt defines?
#define NEWATSROI 1 #define NEWATSROI 1