home · contact · privacy
Server's remake_world() unlinks any pre-existing record file.
[plomrogue] / src / client / command_db.c
index fa125c45171b70877ed552df1974e5073eb16e55..159eb5836c71e46c5cd5402b33655907f8e7c2ae 100644 (file)
@@ -1,6 +1,7 @@
 /* src/client/command_db.c */
 
 #include "command_db.h"
+#include <stddef.h> /* NULL */
 #include <stdint.h> /* uint8_t, uint32_t */
 #include <stdio.h> /* FILE */
 #include <stdlib.h> /* free() */
@@ -30,7 +31,7 @@ static void copy_tokenized_string(char * line, char ** ch_ptr, char * delim)
 
 
 
-extern struct Command * get_command_data(char * dsc_short)
+extern struct Command * get_command(char * dsc_short)
 {
     struct Command * cmd_ptr = world.cmd_db.cmds;
     uint8_t i = 0;
@@ -72,10 +73,10 @@ extern void init_command_db()
         copy_tokenized_string(line, &world.cmd_db.cmds[i].dsc_short, delim);
         copy_tokenized_string(NULL, &world.cmd_db.cmds[i].server_msg, delim);
         if (!strcmp("0", world.cmd_db.cmds[i].server_msg))
-        {
-            free(world.cmd_db.cmds[i].server_msg);
-            world.cmd_db.cmds[i].server_msg = NULL;
-        }
+        {                                          /* .server_msg==0 detects  */
+            free(world.cmd_db.cmds[i].server_msg); /* non-server commands in  */
+            world.cmd_db.cmds[i].server_msg = NULL;/* control.h's try_key() / */
+        }                                          /* try_server_command().   */
         char * arg_string = strtok(NULL, delim);
         world.cmd_db.cmds[i].arg = arg_string[0];
         copy_tokenized_string(NULL, &world.cmd_db.cmds[i].dsc_long, "\n");