allow config to override first unit equipment

This commit is contained in:
Enno Rehling 2017-07-30 14:05:33 +02:00
parent 594cbc4a05
commit 4675cf1d05
1 changed files with 3 additions and 1 deletions

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);
}