summaryrefslogtreecommitdiff
path: root/src/map/pc_groups.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-02 17:14:01 -0300
committershennetsind <ind@henn.et>2013-05-02 17:14:01 -0300
commita2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d (patch)
tree710a44f94cceff2f0198211d21ddfbe99b66f02c /src/map/pc_groups.c
parent219a4f5267b33349649f952266532a132a48c2a3 (diff)
downloadhercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.tar.gz
hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.tar.bz2
hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.tar.xz
hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.zip
Introducing Hercules Plugin Mananger
http://hercules.ws/board/topic/549-introducing-hercules-plugin-manager/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc_groups.c')
-rw-r--r--src/map/pc_groups.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index 2fd143b53..42a068693 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -14,7 +14,6 @@
#include "pc_groups.h"
#include "pc.h" // e_pc_permission
-
typedef struct GroupSettings GroupSettings;
// Cached config settings/pointers for quick lookup
@@ -278,16 +277,18 @@ static void read_config(void) {
if( ( pc_group_max = group_count ) ) {
DBIterator *iter = db_iterator(pc_group_db);
GroupSettings *group_settings = NULL;
- int* group_ids = aMalloc( pc_group_max * sizeof(int) );
+ unsigned int* group_ids = aMalloc( pc_group_max * sizeof(unsigned int) );
int i = 0;
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
group_ids[i++] = group_settings->id;
}
- atcommand->load_groups(group_ids);
-
- aFree(group_ids);
+ if( atcommand->group_ids )
+ aFree(atcommand->group_ids);
+ atcommand->group_ids = group_ids;
+ atcommand->load_groups();
+
dbi_destroy(iter);
}