Merge pull request #716 from ennorehling/master

gmtool improvements
This commit is contained in:
Enno Rehling 2017-08-07 19:07:23 +02:00 committed by GitHub
commit c310249904
3 changed files with 21 additions and 10 deletions

View File

@ -1,10 +1,7 @@
Freust Du Dich, dass es diese Woche wieder einen Eressea-Report gibt?
Möchtest Du dazu beitragen, dass das auch nächste Woche wieder passiert?
Eressea ist ein freiwilliges gratis-Angebot, und die Spielleitung bezahlt
seit Jahren die Entwicklung und das Hosting aus eigener Tasche. Wenn Dir
das etwas wert ist, kannst Du das auf
https://flattr.com/thing/681354/Eressea zum Ausdruck bringen.
Diese Mail enthält ein Attachment mit Deinem Eressea-Report in
komprimierter Form. Um ihn zu entpacken benötigst Du ein Programm,
das ZIP-Archive öffnen kann, wie z.B. 7-Zip (http://www.7-zip.org/)
Eressea ist ein kostenloses Angebot von Freiwilligen, und die Spielleitung bezahlt
seit Jahren die Entwicklung und den Betrieb aus eigener Tasche. Wenn Dir
das etwas wert ist, kannst Du das Spiel auf https://www.patreon.com/enno unterstützen.

View File

@ -886,8 +886,20 @@ static void seed_player(state *st, const newfaction *player) {
pnormalize(&nx, &ny, st->cursor.pl);
r = findregion(nx, ny);
if (r) {
addplayer(r, addfaction(player->email, player->password, player->race,
player->lang, player->subscription));
const char *at = strchr(player->email, '@');
faction *f;
addplayer(r, f = addfaction(player->email, player->password,
player->race, player->lang,
player->subscription));
if (at) {
char fname[64];
size_t len = at - player->email;
if (len>4 && len<sizeof(fname)) {
memcpy(fname, player->email, len);
fname[len]=0;
faction_setname(f, fname);
}
}
}
}
}

View File

@ -286,12 +286,14 @@ faction *addfaction(const char *email, const char *password,
unit *addplayer(region * r, faction * f)
{
unit *u;
const char * name;
const struct equipment* eq;
assert(f->units == NULL);
faction_setorigin(f, 0, r->x, r->y);
u = create_unit(r, f, 1, f->race, 0, NULL, NULL);
eq = get_equipment("first_unit");
name = config_get("rules.equip_first");
eq = get_equipment(name ? name : "first_unit");
if (eq) {
equip_items(&u->items, eq);
}