Re: [Circle] Do_who Parse Error

From: Chaotic (chaotic@eskimo.com)
Date: 08/12/96


On Sun, 11 Aug 1996, Leonard Burns IV wrote:

> I'm getting a parse error after ) on the GET_TITLE(wch)); area on this 
> piece of code, any help? 
> 
> 
> sprintf(Mort_buf, "%s%s[%2d %s %s] %s %s|n",Mort_buf,         
>   ((GET_CLASS(wch) == CLASS_CLERIC) ? CCMAG(ch,C_SPR)) :                
>   ((GET_CLASS(wch) == CLASS_WARRIOR) ? CCYEL(ch,C_SPR)) :               
>   ((GET_CLASS(wch) == CLASS_THIEF) ? CCBLU(ch,C_SPR)) :                 
>   ((GET_CLASS(wch) == CLASS_MAGIC_USER) ? CCRED(ch,C_SPR)),             
                                see this? ^ need a colon here ^        
>   GET_LEVEL(wch), CLASS_ABBR(wch), RACE_ABBR(wch),                 
>   GET_NAME(wch), GET_TITLE(wch));

you have a "?" with no ":" and no second half.  ie., in "X?Y:Z" you have
no colon or "Z" in that statement.

Lauren


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+


From goamkows@kirk.geog.sc.edu Mon, 12 Aug 96 11:01:37 EDT
X-SystemInfo: MyE-Mail: EMail
X-Message-No: 3665 (database)
From: goamkows <goamkows@kirk.geog.sc.edu>
To: circle <circle@cspo.queensu.ca>
Subject: [Circle] dimension door spell help
Date: Mon, 12 Aug 96 16:01:00
Message-ID: <CMM.0.90.0.839862097.goamkows@janeway.geog.sc.edu>
Reply-To: goamkows@kirk.geog.sc.edu (goamkows)
X-POP3-Rcpt: lk4150@per
Return-Path: <@QUCDN.QueensU.CA:owner-circle@cspo.queensu.ca>
Received: from QUCDN.QueensU.CA (QUCDN.QueensU.CA [130.15.126.2]) by per.cybercity.dk (8.6.12/8.6.12) with SMTP id RAA29082 for <lk4150@krull.dk>; Mon, 12 Aug 1996 17:17:23 +0200
Received: from cspo.queensu.ca by QUCDN.QueensU.CA (IBM VM SMTP V2R2) with TCP;Mon, 12 Aug 96 11:24:17 EDT
Received: by cspo.queensu.ca (SMI-8.6/SMI-SVR4)id KAA15969; Mon, 12 Aug 1996 10:56:34 -0500
Received: from otis.cla.sc.edu by cspo.queensu.ca (SMI-8.6/SMI-SVR4)
Received: from kirk.geog.sc.edu by otis.cla.sc.edu (4.1/SMI-4.1)
Received: from janeway.geog.sc.edu by kirk.geog.sc.edu (4.1/SMI-4.1)
Sender: owner-circle@cspo.queensu.ca
Precedence: bulk

well, i've got a spell called dimension door, and about half the time
it works properly, and the other half it crashes the mud :P

the intention is to let it move the player (TAR_CHAR_ROOM |
TAR_SELF_ONLY) to an adjacent room (of use since i'd like it to be
able to move players through locked doors)  and i suspect that the
problem has to do with the way i track down the adjacent rooms, which
is as follows:  

ASPELL(spell_dimension_door)
{
  int tr = 0;
  int j, i, exit = 0;
  int possible_exits[NUM_OF_DIRS];

  for (exit = 0; exit < NUM_OF_DIRS; exit++) {
    if (world[victim->in_room].dir_option[exit])
      if ((world[victim->in_room].dir_option[exit]->to_room != NOWHERE) &&
	(!(ROOM_FLAGGED(world[victim->in_room].dir_option[exit]->to_room, ROOM_PRIVATE | ROOM_DEATH)))) {
	  possible_exits[i] = (world[victim->in_room].dir_option[exit]->to_room);
	  i++;
      }
  }
  
  if (i == 0) {
      send_to_char("Failed!", victim);
      return;
  }

  j = number(1, i);
  tr = possible_exit[j-1];
  if (tr == NOWHERE) { /* should never happen, but just in case :)  */
      send_to_char("Failed!\r\n", victim);
      return;
  }

[move to room tr deleted]
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/07/00 PST