equal
deleted
inserted
replaced
229 team->hogs[i].weaponset = flib_weaponset_retain(set); |
229 team->hogs[i].weaponset = flib_weaponset_retain(set); |
230 } |
230 } |
231 } |
231 } |
232 } |
232 } |
233 |
233 |
|
234 void flib_team_set_health(flib_team *team, int health) { |
|
235 if(team) { |
|
236 for(int i=0; i<HEDGEHOGS_PER_TEAM; i++) { |
|
237 team->hogs[i].initialHealth = health; |
|
238 } |
|
239 } |
|
240 } |
|
241 |
234 char *strdupWithError(const char *in, bool *error) { |
242 char *strdupWithError(const char *in, bool *error) { |
235 char *out = flib_strdupnull(in); |
243 char *out = flib_strdupnull(in); |
236 if(in && !out) { |
244 if(in && !out) { |
237 *error = true; |
245 *error = true; |
238 } |
246 } |
239 return out; |
247 return out; |
240 } |
248 } |
241 |
249 |
242 flib_team *flib_team_copy(flib_team *team) { |
250 flib_team *flib_team_copy(const flib_team *team) { |
243 flib_team *result = NULL; |
251 flib_team *result = NULL; |
244 if(team) { |
252 if(team) { |
245 flib_team *tmpTeam = flib_team_retain(flib_calloc(1, sizeof(flib_team))); |
253 flib_team *tmpTeam = flib_team_retain(flib_calloc(1, sizeof(flib_team))); |
246 if(tmpTeam) { |
254 if(tmpTeam) { |
247 bool error = false; |
255 bool error = false; |
280 |
288 |
281 tmpTeam->rounds = team->rounds; |
289 tmpTeam->rounds = team->rounds; |
282 tmpTeam->wins = team->wins; |
290 tmpTeam->wins = team->wins; |
283 tmpTeam->campaignProgress = team->campaignProgress; |
291 tmpTeam->campaignProgress = team->campaignProgress; |
284 |
292 |
285 tmpTeam->color = team->color; |
293 tmpTeam->colorIndex = team->colorIndex; |
286 tmpTeam->hogsInGame = team->hogsInGame; |
294 tmpTeam->hogsInGame = team->hogsInGame; |
287 tmpTeam->remoteDriven = team->remoteDriven; |
295 tmpTeam->remoteDriven = team->remoteDriven; |
288 |
296 |
289 if(!error) { |
297 if(!error) { |
290 result = tmpTeam; |
298 result = tmpTeam; |