From 2aab736b5911e1f53f0412082a3347d297db4329 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 7 Aug 2017 18:58:39 +0200 Subject: [PATCH] try giving new factions a name --- src/gmtool.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gmtool.c b/src/gmtool.c index 24c1735e8..a07feab43 100644 --- a/src/gmtool.c +++ b/src/gmtool.c @@ -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 && lenemail, len); + fname[len]=0; + faction_setname(f, fname); + } + } } } }