project_files/frontlib/model/weapon.c
changeset 7224 5143861c83bd
parent 7179 f84805e6df03
child 7227 1c859f572d72
--- a/project_files/frontlib/model/weapon.c	Mon Jun 11 00:06:22 2012 +0200
+++ b/project_files/frontlib/model/weapon.c	Tue Jun 12 11:25:05 2012 +0200
@@ -38,7 +38,7 @@
 	if(!name || !loadoutStr || !crateProbStr || !crateAmmoStr || !delayStr) {
 		flib_log_e("null parameter in flib_weaponset_create_str");
 	} else {
-		flib_weaponset *newSet = calloc(1, sizeof(flib_weaponset));
+		flib_weaponset *newSet = flib_calloc(1, sizeof(flib_weaponset));
 		char *nameCopy = flib_strdupnull(name);
 		if(newSet && nameCopy) {
 			newSet->name = nameCopy;
@@ -101,7 +101,10 @@
 	if(!filename || !set) {
 		flib_log_e("null parameter in flib_weaponset_to_ini");
 	} else {
-		dictionary *dict = dictionary_new(0);
+		dictionary *dict = iniparser_load(filename);
+		if(!dict) {
+			dict = dictionary_new(0);
+		}
 		if(dict) {
 			bool error = false;
 			// Add the sections