summaryrefslogtreecommitdiff
path: root/src/map/pc.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-12-15 19:28:03 -0200
committershennetsind <ind@henn.et>2013-12-15 19:28:03 -0200
commitf6daed397dee844234cacd90d395c0b74c404598 (patch)
tree1d240f974dab6dc751cef88cca32aa8819bab99b /src/map/pc.h
parentee1290403076d39d25def09753cf20c1dd157d09 (diff)
downloadhercules-f6daed397dee844234cacd90d395c0b74c404598.tar.gz
hercules-f6daed397dee844234cacd90d395c0b74c404598.tar.bz2
hercules-f6daed397dee844234cacd90d395c0b74c404598.tar.xz
hercules-f6daed397dee844234cacd90d395c0b74c404598.zip
Replaced pc->pc_has_permission/can_give_items/can_give_bound_items with equivalent macros
Because 2/3 jumps to perform such a operation is just awful Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc.h')
-rw-r--r--src/map/pc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index 0cad4f5c6..5264fa557 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -684,7 +684,11 @@ enum equip_pos {
#define pc_readaccountreg2str(sd,reg) (pc->readregistry_str((sd),(reg),1))
#define pc_setaccountreg2str(sd,reg,val) (pc->setregistry_str((sd),(reg),(val),1))
+/* pc_groups easy access */
#define pc_get_group_level(sd) ( (sd)->group->level )
+#define pc_has_permission(sd,permission) ( ((sd)->extra_temp_permissions&(permission)) != 0 || ((sd)->group->e_permissions&(permission)) != 0 )
+#define pc_can_give_items(sd) ( pc_has_permission((sd),PC_PERM_TRADE) )
+#define pc_can_give_bound_items(sd) ( pc_has_permission((sd),PC_PERM_TRADE_BOUND) )
struct skill_tree_entry {
short id;
@@ -761,7 +765,6 @@ struct pc_interface {
bool (*can_give_bound_items) (struct map_session_data *sd);
bool (*can_use_command) (struct map_session_data *sd, const char *command);
- bool (*has_permission) (struct map_session_data *sd, unsigned int permission);
int (*set_group) (struct map_session_data *sd, int group_id);
bool (*should_log_commands) (struct map_session_data *sd);