Woopee! My first actual homemade code snippet!.....And it doesn't work :(

From: NeoStar (neostar@inorbit.com)
Date: 08/14/01


ACMD(do_gohome)
{
+-----------------------------------------------------------------
|  int loss;
|
| /* If they are fighting, take away exp */
|  if (GET_POS(ch) = POS_FIGHTING){
|      loss = GET_MAX_HIT(ch) - GET_HIT(ch);
|      if (GET_MOVE(ch) <= 1) {
|       loss = 1;}
|      else {
|         loss *= GET_LEVEL(ch) * 1.5;}
|      gain_exp(ch, -loss);
|  }
|
|  /* If they are almost dead (immobile) return! */
|  if (GET_POS(ch) < POS_FIGHTING)  {
| send_to_char("&0&1You are in pretty bad shape, unable to recall!&0 \r\n",
ch);
|   return;
|  }
|
|  /* If they are exhausted, "return" them! */
|  if (GET_MOVE(ch) <= 1)  {
|    if (GET_POS(ch) <= POS_FIGHTING)  {
|    act("You couldn't recall from combat!!!\r\n", TRUE, ch, 0, 0,
TO_CHAR);
|      return;}
|    else  {
|    act("You are WAY too exhausted for that!\r\n", TRUE, ch, 0, 0,
TO_CHAR);
|      return;}
|  }
|  else  {
+--------------------------------------------------------
   act("$n recalls.\r\n", TRUE, ch, 0, 0, TO_ROOM);
   char_from_room(ch);
   char_to_room(ch, r_mortal_start_room);
   GET_MOVE(ch) = (GET_MOVE(ch) / 2);
   act("$n appears in the room.\r\n", TRUE, ch, 0, 0, TO_ROOM);
   look_at_room(ch, 0);
+------------------------------------------------------
| }
+-------------------------------------------------------
}

The code within the "brackets" is the newest stuff. But after I implemented
it, for some reason it made all characters stay in POS_FIGHTING. I don't
see how it did that because I never set the position... I don't think
The code outside the brackets works fine... (probably because I stole it
from WORD_OF_RECALL ;))

-Neostar
It's ok, I'm just adding to the spam I have already created

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST