project_files/frontlib/model/team.c
changeset 7230 240620f46dd7
parent 7227 1c859f572d72
child 7271 5608ac657362
--- a/project_files/frontlib/model/team.c	Tue Jun 12 21:10:11 2012 +0200
+++ b/project_files/frontlib/model/team.c	Fri Jun 15 19:57:25 2012 +0200
@@ -194,6 +194,7 @@
 		for(int i=0; i<HEDGEHOGS_PER_TEAM; i++) {
 			free(team->hogs[i].name);
 			free(team->hogs[i].hat);
+			flib_weaponset_release(team->hogs[i].weaponset);
 		}
 		free(team->name);
 		free(team->grave);
@@ -208,7 +209,15 @@
 		}
 		free(team->bindings);
 		free(team->hash);
-		flib_weaponset_destroy(team->weaponset);
 		free(team);
 	}
 }
+
+void flib_team_set_weaponset(flib_team *team, flib_weaponset *set) {
+	if(team) {
+		for(int i=0; i<HEDGEHOGS_PER_TEAM; i++) {
+			flib_weaponset_release(team->hogs[i].weaponset);
+			team->hogs[i].weaponset = flib_weaponset_retain(set);
+		}
+	}
+}