Go to the source code of this file.
Functions | |
void | debug_makemechs (dbref player, void *data, char *buffer) |
void | fun_btmakemechs (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void debug_makemechs | ( | dbref | player, | |
void * | data, | |||
char * | buffer | |||
) |
Definition at line 148 of file mech.avail.c.
References args, compare_array(), DOCHECK, mech_list_maker(), mech_parseattributes(), Readnum, and side_names_short.
00149 { 00150 char *args[7]; 00151 int argc; 00152 int table; 00153 int tons; 00154 int opt = 0; 00155 int max = 0; 00156 int types = 0xff; 00157 00158 argc = mech_parseattributes(buffer, args, 6); 00159 DOCHECK(argc < 2, "Insufficient arguments!"); 00160 DOCHECK(argc > 5, "Too many arguments!"); 00161 DOCHECK((table = 00162 compare_array(side_names_short, args[0])) < 0, 00163 "Invalid faction name!"); 00164 DOCHECK((tons = atoi(args[1])) < 20, "Invalid tonnage!"); 00165 DOCHECK(tons > 4000, "Max of 4000 tons of mecha at once! Sowwy!"); 00166 if(argc > 2) { 00167 DOCHECK(Readnum(types, args[2]), "Invalid type bitvector!"); 00168 if(argc > 3) { 00169 DOCHECK((opt = atoi(args[3])) < 20, "Invalid optTonnage!"); 00170 if(argc > 4) 00171 DOCHECK((max = atoi(args[4])) < 5, "Invalid MaxDifference!"); 00172 } 00173 } 00174 mech_list_maker(player, table, types, tons, opt, max, 0, NULL); 00175 }
void fun_btmakemechs | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 180 of file mech.avail.c.
References compare_array(), FUNCHECK, LBUF_SIZE, mech_list_maker(), Readnum, safe_tprintf_str(), and side_names_short.
00182 { 00183 /* fargs[0] = faction 00184 fargs[1] = numtons 00185 fargs[2] = types 00186 fargs[3] = opttons 00187 fargs[4] = maxvar 00188 */ 00189 int table; 00190 int tons; 00191 int opt = 0; 00192 int max = 0; 00193 char buf[LBUF_SIZE]; 00194 int types = 0xff; 00195 00196 FUNCHECK(nfargs < 2, "#-1 Insufficient arguments!"); 00197 FUNCHECK(nfargs > 5, "#-1 Too many arguments!"); 00198 FUNCHECK((table = 00199 compare_array(side_names_short, fargs[0])) < 0, 00200 "#-1 Invalid faction name!"); 00201 FUNCHECK((tons = atoi(fargs[1])) < 20, "#-1 Invalid tonnage!"); 00202 FUNCHECK(tons > 4000, "#-1 Max of 4000 tons of mecha at once! Sowwy!"); 00203 if(nfargs > 2) { 00204 FUNCHECK(Readnum(types, fargs[2]), "#-1 Invalid type bitvector!"); 00205 if(nfargs > 3) { 00206 FUNCHECK((opt = atoi(fargs[3])) < 20, "#-1 Invalid optTonnage!"); 00207 if(nfargs > 4) 00208 FUNCHECK((max = 00209 atoi(fargs[4])) < 5, "#-1 Invalid MaxDifference!"); 00210 } 00211 } 00212 mech_list_maker(player, table, types, tons, opt, max, 1, buf); 00213 safe_tprintf_str(buff, bufc, "%s", buf); 00214 }