1 | /* |
1 | /* |
2 | * static char *rcsid_c_misc_c = |
2 | * static char *rcsid_c_misc_c = |
3 | * "$Id: c_misc.c,v 1.1.1.1 2006/02/03 07:14:28 root Exp $"; |
3 | * "$Id: c_misc.c,v 1.1.1.2 2006/02/22 18:03:19 elmex Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
441 | break; |
441 | break; |
442 | case 'a' : strcpy(return_val,(QUERY_FLAG(pl->ob,FLAG_AFK)?" [AFK]":"")); |
442 | case 'a' : strcpy(return_val,(QUERY_FLAG(pl->ob,FLAG_AFK)?" [AFK]":"")); |
443 | break; |
443 | break; |
444 | case 'm' : strcpy(return_val,pl->ob->map->path); |
444 | case 'm' : strcpy(return_val,pl->ob->map->path); |
445 | break; |
445 | break; |
446 | case 'M' : strcpy(return_val,pl->ob->map->name); |
446 | case 'M' : strcpy(return_val,pl->ob->map->name?pl->ob->map->name:"Untitled"); |
447 | break; |
447 | break; |
448 | case 'r' : strcpy(return_val,get_name_of_region_for_map(pl->ob->map)); |
448 | case 'r' : strcpy(return_val,get_name_of_region_for_map(pl->ob->map)); |
449 | break; |
449 | break; |
450 | case 'R' : strcpy(return_val,get_region_longname(get_region_by_map(pl->ob->map))); |
450 | case 'R' : strcpy(return_val,get_region_longname(get_region_by_map(pl->ob->map))); |
451 | break; |
451 | break; |
… | |
… | |
945 | } |
945 | } |
946 | |
946 | |
947 | int command_applymode(object *op, char *params) |
947 | int command_applymode(object *op, char *params) |
948 | { |
948 | { |
949 | unapplymode unapply = op->contr->unapply; |
949 | unapplymode unapply = op->contr->unapply; |
950 | static char *types[]={"nochoice", "never", "always"}; |
950 | static const char* const types[]={"nochoice", "never", "always"}; |
951 | |
951 | |
952 | if (!params) { |
952 | if (!params) { |
953 | new_draw_info_format(NDI_UNIQUE, 0, op, "applymode is set to %s", |
953 | new_draw_info_format(NDI_UNIQUE, 0, op, "applymode is set to %s", |
954 | types[op->contr->unapply]); |
954 | types[op->contr->unapply]); |
955 | return 1; |
955 | return 1; |
… | |
… | |
974 | } |
974 | } |
975 | |
975 | |
976 | int command_bowmode(object *op, char *params) |
976 | int command_bowmode(object *op, char *params) |
977 | { |
977 | { |
978 | bowtype_t oldtype=op->contr->bowtype; |
978 | bowtype_t oldtype=op->contr->bowtype; |
979 | static char *types[] = |
979 | static const char* const types[] = |
980 | {"normal", "threewide", "spreadshot", "firenorth", |
980 | {"normal", "threewide", "spreadshot", "firenorth", |
981 | "firene", "fireeast", "firese", "firesouth", |
981 | "firene", "fireeast", "firese", "firesouth", |
982 | "firesw", "firewest", "firenw", "bestarrow"}; |
982 | "firesw", "firewest", "firenw", "bestarrow"}; |
983 | char buf[MAX_BUF]; |
983 | char buf[MAX_BUF]; |
984 | int i, found; |
984 | int i, found; |
… | |
… | |
1016 | } |
1016 | } |
1017 | |
1017 | |
1018 | int command_petmode(object *op, char *params) |
1018 | int command_petmode(object *op, char *params) |
1019 | { |
1019 | { |
1020 | petmode_t oldtype=op->contr->petmode; |
1020 | petmode_t oldtype=op->contr->petmode; |
1021 | static char *types[]={"normal", "sad", "defend", "arena"}; |
1021 | static const char* const types[]={"normal", "sad", "defend", "arena"}; |
1022 | |
1022 | |
1023 | if (!params) { |
1023 | if (!params) { |
1024 | new_draw_info_format(NDI_UNIQUE, 0, op, "petmode is set to %s", |
1024 | new_draw_info_format(NDI_UNIQUE, 0, op, "petmode is set to %s", |
1025 | types[op->contr->petmode]); |
1025 | types[op->contr->petmode]); |
1026 | return 1; |
1026 | return 1; |
… | |
… | |
1087 | } |
1087 | } |
1088 | |
1088 | |
1089 | int command_usekeys(object *op, char *params) |
1089 | int command_usekeys(object *op, char *params) |
1090 | { |
1090 | { |
1091 | usekeytype oldtype=op->contr->usekeys; |
1091 | usekeytype oldtype=op->contr->usekeys; |
1092 | static char *types[]={"inventory", "keyrings", "containers"}; |
1092 | static const char* const types[]={"inventory", "keyrings", "containers"}; |
1093 | |
1093 | |
1094 | if (!params) { |
1094 | if (!params) { |
1095 | new_draw_info_format(NDI_UNIQUE, 0, op, "usekeys is set to %s", |
1095 | new_draw_info_format(NDI_UNIQUE, 0, op, "usekeys is set to %s", |
1096 | types[op->contr->usekeys]); |
1096 | types[op->contr->usekeys]); |
1097 | return 1; |
1097 | return 1; |