ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_misc.C
(Generate patch)

Comparing deliantra/server/server/c_misc.C (file contents):
Revision 1.34 by pippijn, Sat Jan 6 14:42:30 2007 UTC vs.
Revision 1.35 by root, Sun Jan 7 02:39:14 2007 UTC

1142 return 0; 1142 return 0;
1143 } 1143 }
1144} 1144}
1145 1145
1146int 1146int
1147command_quit (object *op, char *params)
1148{
1149 new_draw_info (NDI_UNIQUE, 0, op,
1150 "Quitting will delete your character PERMANENTLY. If you are sure you want to do this, then use the quit_character command instead of quit.");
1151 return 1;
1152}
1153
1154int
1155command_real_quit (object *op, char *params)
1156{
1157 send_query (op->contr->ns, CS_QUERY_SINGLECHAR, "Quitting will delete your character.\nAre you sure you want to quit (y/n):");
1158
1159 op->contr->ns->state = ST_CONFIRM_QUIT;
1160 return 1;
1161}
1162
1163/*
1164 * don't allow people to exit explore mode. It otherwise becomes
1165 * really easy to abuse this.
1166 */
1167int
1168command_explore (object *op, char *params)
1169{
1170 if (settings.explore_mode == FALSE)
1171 return 1;
1172 /*
1173 * I guess this is the best way to see if we are solo or not. Actually,
1174 * are there any cases when first_player->next==NULL and we are not solo?
1175 */
1176 if ((first_player != op->contr) || (first_player->next != NULL))
1177 {
1178 new_draw_info (NDI_UNIQUE, 0, op, "You can not enter explore mode if you are in a party");
1179 }
1180 else if (op->contr->explore)
1181 new_draw_info (NDI_UNIQUE, 0, op, "There is no return from explore mode");
1182 else
1183 {
1184 op->contr->explore = 1;
1185 new_draw_info (NDI_UNIQUE, 0, op, "You are now in explore mode");
1186 }
1187 return 1;
1188}
1189
1190int
1191command_sound (object *op, char *params) 1147command_sound (object *op, char *params)
1192{ 1148{
1193 if (op->contr->ns->sound) 1149 if (op->contr->ns->sound)
1194 { 1150 {
1195 op->contr->ns->sound = 0; 1151 op->contr->ns->sound = 0;
1200 op->contr->ns->sound = 1; 1156 op->contr->ns->sound = 1;
1201 new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled."); 1157 new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled.");
1202 } 1158 }
1203 1159
1204 return 1; 1160 return 1;
1205}
1206
1207int
1208explore_mode (void)
1209{
1210 player *pl;
1211
1212 if (settings.explore_mode == TRUE)
1213 {
1214 for (pl = first_player; pl != (player *) NULL; pl = pl->next)
1215 if (pl->explore)
1216 return 1;
1217 }
1218 return 0;
1219} 1161}
1220 1162
1221int 1163int
1222command_title (object *op, char *params) 1164command_title (object *op, char *params)
1223{ 1165{
1259 { 1201 {
1260 new_draw_info (NDI_UNIQUE, 0, op, "Title too long."); 1202 new_draw_info (NDI_UNIQUE, 0, op, "Title too long.");
1261 return 1; 1203 return 1;
1262 } 1204 }
1263 strcpy (op->contr->own_title, params); 1205 strcpy (op->contr->own_title, params);
1264 return 1;
1265}
1266
1267int
1268command_save (object *op, char *params)
1269{
1270 if (!op->stats.exp)
1271 new_draw_info (NDI_UNIQUE, 0, op, "You don't deserve to save yet.");
1272 else
1273 {
1274 op->contr->save ();
1275 new_draw_info (NDI_UNIQUE, 0, op, "You have been saved.");
1276 }
1277
1278 return 1; 1206 return 1;
1279} 1207}
1280 1208
1281int 1209int
1282command_peaceful (object *op, char *params) 1210command_peaceful (object *op, char *params)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines