summaryrefslogtreecommitdiff
path: root/src/map/pc_groups.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-01-13 23:52:27 -0200
committershennetsind <ind@henn.et>2014-01-13 23:52:27 -0200
commite1a0059919dbc4f5c7e803a496b8d150c0a070f5 (patch)
tree1f6b3b05202e9401ca8eadf3777cc8710a8eab05 /src/map/pc_groups.c
parent8d1b8108fcad1a628531801914950b5f92767b0a (diff)
downloadhercules-e1a0059919dbc4f5c7e803a496b8d150c0a070f5.tar.gz
hercules-e1a0059919dbc4f5c7e803a496b8d150c0a070f5.tar.bz2
hercules-e1a0059919dbc4f5c7e803a496b8d150c0a070f5.tar.xz
hercules-e1a0059919dbc4f5c7e803a496b8d150c0a070f5.zip
Fixed HPM support for group permissions
pcg->add_permission dropped, use 'AddGroupPermission("name",unsigned int var for mask id)' Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc_groups.c')
-rw-r--r--src/map/pc_groups.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index 59dd951c7..4ddb95c9b 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -423,10 +423,17 @@ void do_init_pc_groups(void) {
for(i = 0; i < len; i++) {
unsigned int p;
- if( ( p = pcg->add_permission(pc_g_defaults[i].name) ) != pc_g_defaults[i].permission )
+ if( ( p = pc_groups_add_permission(pc_g_defaults[i].name) ) != pc_g_defaults[i].permission )
ShowError("do_init_pc_groups: %s error : %d != %d\n",pc_g_defaults[i].name,p,pc_g_defaults[i].permission);
}
+ /**
+ * Handle plugin-provided permissions
+ **/
+ for(i = 0; i < pcg->HPMpermissions_count; i++) {
+ *pcg->HPMpermissions[i].mask = pc_groups_add_permission(pcg->HPMpermissions[i].name);
+ }
+
pcg->db = idb_alloc(DB_OPT_RELEASE_DATA);
pcg->name_db = stridb_alloc(DB_OPT_DUP_KEY, 0);
@@ -502,6 +509,9 @@ void pc_groups_defaults(void) {
pcg->permissions = NULL;
pcg->permission_count = 0;
/* */
+ pcg->HPMpermissions = NULL;
+ pcg->HPMpermissions_count = 0;
+ /* */
pcg->init = do_init_pc_groups;
pcg->final = do_final_pc_groups;
pcg->reload = pc_groups_reload;
@@ -514,5 +524,4 @@ void pc_groups_defaults(void) {
pcg->get_name = pc_group_get_name;
pcg->get_level = pc_group_get_level;
pcg->get_idx = pc_group_get_idx;
- pcg->add_permission = pc_groups_add_permission;
}