equal
deleted
inserted
replaced
173 flib_cfg_release(conn->scheme); |
173 flib_cfg_release(conn->scheme); |
174 conn->scheme = copy; |
174 conn->scheme = copy; |
175 } |
175 } |
176 } |
176 } |
177 |
177 |
178 flib_gamesetup *flib_netconn_create_gameSetup(flib_netconn *conn) { |
178 flib_gamesetup *flib_netconn_create_gamesetup(flib_netconn *conn) { |
179 flib_gamesetup *result = NULL; |
179 flib_gamesetup *result = NULL; |
180 if(!conn) { |
180 if(!conn) { |
181 flib_log_e("null parameter in flib_netconn_create_gameSetup"); |
181 flib_log_e("null parameter in flib_netconn_create_gameSetup"); |
182 } else { |
182 } else { |
183 if(conn->teamlist.teamCount==0 || !conn->scheme || !conn->weaponset) { |
183 if(conn->teamlist.teamCount==0 || !conn->scheme || !conn->weaponset) { |
191 result->teamlist = flib_teamlist_create(); |
191 result->teamlist = flib_teamlist_create(); |
192 for(int i=0; i<conn->teamlist.teamCount; i++) { |
192 for(int i=0; i<conn->teamlist.teamCount; i++) { |
193 flib_team *copy = flib_team_copy(conn->teamlist.teams[i]); |
193 flib_team *copy = flib_team_copy(conn->teamlist.teams[i]); |
194 if(copy) { |
194 if(copy) { |
195 flib_team_set_weaponset(copy, conn->weaponset); |
195 flib_team_set_weaponset(copy, conn->weaponset); |
196 flib_team_set_health(copy, conn->scheme->settings[2]); // TODO by name |
196 flib_team_set_health(copy, flib_cfg_get_setting(conn->scheme, "health", 100)); |
197 flib_teamlist_insert(result->teamlist, copy, result->teamlist->teamCount); |
197 flib_teamlist_insert(result->teamlist, copy, result->teamlist->teamCount); |
198 } |
198 } |
199 flib_team_release(copy); |
199 flib_team_release(copy); |
200 } |
200 } |
201 if(result->map->mapgen == MAPGEN_NAMED && result->map->name) { |
201 if(result->map->mapgen == MAPGEN_NAMED && result->map->name) { |