OK, being called a crappy coder by someone earlier today, I'm a bit
angry/depressed, so sorry if I get on any of your nerves.... Here's a
snip from my look_at_char fuction... I've marked where I started (and
ended) trying to stack the # of objs with the same description with
comments... This is just one of my numerous problems :P I've got yet
another that I can't seem to figure out, with details below this snip of
code.
/* Start Snip */
act("\r\nYou attempt to peek at $s inventory:", FALSE, i, 0, ch,
TO_VICT);
for (tmp_obj = i->carrying; tmp_obj; tmp_obj = tmp_obj->next_content)
{
if (CAN_SEE_OBJ(ch, tmp_obj) && (number(0, 20) < GET_LEVEL(ch))) {
/* Begin stacking */
for(nxt_obj = tmp_obj; nxt_obj; nxt_obj = nxt_obj->next_content) {
if(nxt_obj->item_number != NOTHING){
if(strcmp(nxt_obj->short_description, tmp_obj->short_description)
== 0)
break;
}
else if (nxt_obj->item_number==tmp_obj->item_number) break;
if (nxt_obj!=tmp_obj) continue;
for (nxt_obj = tmp_obj; nxt_obj; nxt_obj = nxt_obj->next_content){
if (nxt_obj->item_number==NOTHING) {
if(strcmp(nxt_obj->short_description,tmp_obj->short_description)==0)
num++;
}
else if (nxt_obj->item_number==tmp_obj->item_number)
num++;
if (CAN_SEE_OBJ(ch, tmp_obj)) {
if (num!=1) {
sprintf(buf,"[%2i ] ",num);
strcat(buf, tmp_obj->short_description);
send_to_char(buf, ch);
}
}
}
}
/* End stacking */
found = TRUE;
}
}
/* End Snip */
My second problem is that I'm getting errors(duh) when prototyping
functions in a file..... At the top is:
void init_empires(FILE * fl);
void emp_status(struct char_data *ch, int empire);
char alliances(int empire);
char norelat(int empire);
char wars(int empire);
void empint_to_str(struct char_data *ch);
int defect_check(char *string, struct char_data *ch);
int empstr_to_int(char *string);
ACMD(do_empire);
struct empire_data *emp = CREATE(emp, struct empire_data, NUM_EMPS); //
Dynamic empire array
and later on comes this:
void init_empires(FILE * fl){
extern int top_of_p_table;
extern struct player_index_element *player_table;
...
and I get this error during compilation:
empire.c(13) : error C2059: syntax error : 'PCH creation point'
Now, line 13 is the void init_empires(FILE * fl); at the top of the file.
And, just to see if I can stump you guys anymore, I have yet another
problem! :)
empire.c(23) : error C2059: syntax error : 'do'
empire.c(23) : error C2059: syntax error : 'while'
Line 23 is: struct empire_data *emp = CREATE(emp, struct empire_data,
NUM_EMPS); // Dynamic empire array
NUM_EMPS is defined as 10
For your convenience, I've copied and pasted the CREATE macro...
#define CREATE(result, type, number) do {\
if (!((result) = (type *) calloc ((number), sizeof(type))))\
{ perror("malloc failure"); abort(); } } while(0)
Anyone know what I could be doing? Sorry for not knowing anything else
that could help you out...
-Phillip
Phillip Ames | Implementor of Apocalypse MUD
kirk47@juno.com | telnet://oberon.krans.com:1701
ICQ: 8778335 | AOL IM: Grathol
http://members.xoom.com/Gowron/index.html
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST