Procházet zdrojové kódy

Added new group permission as discussed with other developers "disable_commands_when_dead"

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16751 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind před 12 roky
rodič
revize
0beeb8ebf6
3 změnil soubory, kde provedl 29 přidání a 20 odebrání
  1. 3 0
      conf/msg_athena.conf
  2. 4 0
      src/map/atcommand.c
  3. 22 20
      src/map/pc_groups.h

+ 3 - 0
conf/msg_athena.conf

@@ -1342,5 +1342,8 @@
 1391: You do not possess a cart to be removed
 1392: Cart Added.
 
+// atcommand.c::is_atcommand
+1393: You can't use commands while dead.
+
 //Custom translations
 import: conf/import/msg_conf.txt

+ 4 - 0
src/map/atcommand.c

@@ -9322,6 +9322,10 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
 		    (*command == charcommand_symbol && info->char_groups[sd->group_pos] == 0) ) {
 			return false;
 		}
+		if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) {
+			clif_displaymessage(fd, msg_txt(1393)); // You can't use commands while dead
+			return true;
+		}
 	}
 
 	// Check if target is valid only if confirmed that player can use command.

+ 22 - 20
src/map/pc_groups.h

@@ -22,26 +22,27 @@ void pc_groups_reload(void);
 
 enum e_pc_permission {
 	PC_PERM_NONE                = 0,
-	PC_PERM_TRADE               = 0x00001,
-	PC_PERM_PARTY               = 0x00002,
-	PC_PERM_ALL_SKILL           = 0x00004,
-	PC_PERM_USE_ALL_EQUIPMENT   = 0x00008,
-	PC_PERM_SKILL_UNCONDITIONAL = 0x00010,
-	PC_PERM_JOIN_ALL_CHAT       = 0x00020,
-	PC_PERM_NO_CHAT_KICK        = 0x00040,
-	PC_PERM_HIDE_SESSION        = 0x00080,
-	PC_PERM_WHO_DISPLAY_AID     = 0x00100,
-	PC_PERM_RECEIVE_HACK_INFO   = 0x00200,
-	PC_PERM_WARP_ANYWHERE       = 0x00400,
-	PC_PERM_VIEW_HPMETER        = 0x00800,
-	PC_PERM_VIEW_EQUIPMENT      = 0x01000,
-	PC_PERM_USE_CHECK           = 0x02000,
-	PC_PERM_USE_CHANGEMAPTYPE   = 0x04000,
-	PC_PERM_USE_ALL_COMMANDS    = 0x08000,
-	PC_PERM_RECEIVE_REQUESTS    = 0x10000,
-	PC_PERM_SHOW_BOSS			= 0x20000,
-	PC_PERM_DISABLE_PVM			= 0x40000,
-	PC_PERM_DISABLE_PVP			= 0x80000,
+	PC_PERM_TRADE               = 0x000001,
+	PC_PERM_PARTY               = 0x000002,
+	PC_PERM_ALL_SKILL           = 0x000004,
+	PC_PERM_USE_ALL_EQUIPMENT   = 0x000008,
+	PC_PERM_SKILL_UNCONDITIONAL = 0x000010,
+	PC_PERM_JOIN_ALL_CHAT       = 0x000020,
+	PC_PERM_NO_CHAT_KICK        = 0x000040,
+	PC_PERM_HIDE_SESSION        = 0x000080,
+	PC_PERM_WHO_DISPLAY_AID     = 0x000100,
+	PC_PERM_RECEIVE_HACK_INFO   = 0x000200,
+	PC_PERM_WARP_ANYWHERE       = 0x000400,
+	PC_PERM_VIEW_HPMETER        = 0x000800,
+	PC_PERM_VIEW_EQUIPMENT      = 0x001000,
+	PC_PERM_USE_CHECK           = 0x002000,
+	PC_PERM_USE_CHANGEMAPTYPE   = 0x004000,
+	PC_PERM_USE_ALL_COMMANDS    = 0x008000,
+	PC_PERM_RECEIVE_REQUESTS    = 0x010000,
+	PC_PERM_SHOW_BOSS			= 0x020000,
+	PC_PERM_DISABLE_PVM			= 0x040000,
+	PC_PERM_DISABLE_PVP			= 0x080000,
+	PC_PERM_DISABLE_CMD_DEAD    = 0x100000,
 };
 
 static const struct {
@@ -68,6 +69,7 @@ static const struct {
 	{ "show_bossmobs", PC_PERM_SHOW_BOSS },
 	{ "disable_pvm", PC_PERM_DISABLE_PVM },
 	{ "disable_pvp", PC_PERM_DISABLE_PVP },
+	{ "disable_commands_when_dead", PC_PERM_DISABLE_CMD_DEAD },
 };
 
 #endif // _PC_GROUPS_H_