Esempio n. 1
0
const ship_type *st_find(const char *name) {
    ship_type *st = st_find_i(name);
    if (!st) {
        log_warning("st_find: could not find ship '%s'\n", name);
    }
    return st;
}
Esempio n. 2
0
ship_type *st_get_or_create(const char * name) {
    ship_type * st = st_find_i(name);
    if (!st) {
        st = (ship_type *)calloc(sizeof(ship_type), 1);
        st->_name = _strdup(name);
        st->storm = 1.0;
        ql_push(&shiptypes, (void *)st);
    }
    return st;
}
Esempio n. 3
0
ship_type *st_get_or_create(const char * name) {
    ship_type * st = st_find_i(name);
    assert(!snames);
    if (!st) {
        st = (ship_type *)calloc(1, sizeof(ship_type));
        if (!st) abort();
        st->_name = str_strdup(name);
        st->storm = 1.0;
        st->tac_bonus = 1.0;
        st_register(st);
    }
    return st;
}
Esempio n. 4
0
const ship_type *st_find(const char *name) {
    return st_find_i(name);
}