case spell hickup - whats wrong ?

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 years 11 months ago - 2 years 11 months ago #6997 by JTP
I made this spell, the code compiles, spell works when there is an ITEM_TREE in the room.

BUT

When there is no tree, i some times only get an Okay. when cast. Other times i get the correct send_to_char.

So whats up, would be good to get the send_to_char every time there is no tree.
/* Every spell that does an affect comes through here.  This determines the
 * effect, whether it is added or replacement, whether it is legal or not, etc.
 * affect_join(vict, aff, add_dur, avg_dur, add_mod, avg_mod) */
#define MAX_SPELL_AFFECTS 5     /* change if more needed */
void mag_affects(int level, struct char_data *ch, struct char_data *victim,
                      int spellnum, int savetype)
{
  struct affected_type af[MAX_SPELL_AFFECTS];
  bool accum_affect = FALSE, accum_duration = FALSE;
  const char *to_vict = NULL, *to_room = NULL;
  int i, j;
  if (victim == NULL || ch == NULL)
    return;
  for (i = 0; i < MAX_SPELL_AFFECTS; i++) {
    new_affect(&(af[i]));
    af[i].spell = spellnum;
  }

  switch (spellnum) {

  case SPELL_TREE_TRAVEL:
{
struct obj_data *tree;
for (tree = world[ch->in_room].contents; tree; tree = tree->next_content) {
  if (GET_OBJ_TYPE(tree) != ITEM_TREE) {
    send_to_char(ch, "But there is no tree around to travel from.\r\n");
    return;
    }
    af[0].duration = 24;
    SET_BIT_AR(af[0].bitvector, AFF_TREE_TRAVEL);
    accum_duration = FALSE;
    to_vict = "You feel one with the trees!";
 }
}
    break;
} /* end of cases */
Last edit: 2 years 11 months ago by JTP.

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
2 years 11 months ago #6999 by zusuk
Replied by zusuk on topic case spell hickup - whats wrong ?
Please login to view the answers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
2 years 11 months ago #7000 by zusuk
Replied by zusuk on topic case spell hickup - whats wrong ?
Please login to view the answers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
2 years 11 months ago #7002 by zusuk
Replied by zusuk on topic case spell hickup - whats wrong ?
Please login to view the answers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 years 11 months ago #7003 by JTP
Replied by JTP on topic case spell hickup - whats wrong ?
Please login to view the answers

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
2 years 11 months ago #7004 by zusuk
Replied by zusuk on topic case spell hickup - whats wrong ?
Please login to view the answers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 years 11 months ago #7005 by JTP
Replied by JTP on topic case spell hickup - whats wrong ?
Please login to view the answers

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
2 years 11 months ago #7006 by zusuk
Replied by zusuk on topic case spell hickup - whats wrong ?
Please login to view the answers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100
The following user(s) said Thank You: JTP

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #7007 by thomas
Replied by thomas on topic case spell hickup - whats wrong ?
Please login to view the answers

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 years 11 months ago #7008 by JTP
Replied by JTP on topic case spell hickup - whats wrong ?
Please login to view the answers

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
2 years 11 months ago #7009 by zusuk
Replied by zusuk on topic case spell hickup - whats wrong ?
Please login to view the answers

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 years 11 months ago #7010 by JTP
Replied by JTP on topic case spell hickup - whats wrong ?
Please login to view the answers

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #7012 by thomas
Replied by thomas on topic case spell hickup - whats wrong ?
Please login to view the answers

Please Log in or Create an account to join the conversation.

Time to create page: 0.223 seconds