Re: a bug?? - The Fix has no bug !!

From: Katzlberger Thomas (cat@garfield.Vanderbilt.Edu)
Date: 09/02/95


Hi,

There is NO bug in this function.
I don't publish buggy code !
It's working quite fine for a while ...

ACMD(do_flee)
{
	int       i, attempt, loss, hit, level;

	if (!FIGHTING(ch))
	{
		act("$n panics but nobody knows why!", TRUE, ch, 0,  
0, TO_ROOM);
		send_to_char("Easy! Easy! Don't panic, nobody is  
fighting you.\r\n", ch);
		return;
	}

	hit = GET_MAX_HIT(FIGHTING(ch));
	level = GET_LEVEL(FIGHTING(ch));

	for (i = 0; i < 6; i++)
	{
		attempt = number(0, NUM_OF_DIRS - 1);	/* Select a  
random direction */

		if (CAN_GO(ch, attempt) &&
			!IS_SET(ROOM_FLAGS(EXIT_ROOM(ch, attempt)),  
ROOM_DEATH))
		{
			act("$n panics, and attempts to flee!",  
TRUE, ch, 0, 0, TO_ROOM);

			if (do_simple_move(ch, attempt, TRUE))
			{
				send_to_char("You flee head over  
heels.\r\n", ch);

				if (!IS_NPC(ch))
				{
					loss = /* loss formula */;

					gain_exp(ch, -loss);
					sprintf(buf, "You lose %d  
points.\r\n", loss);
					send_to_char(buf, ch);
				}
			}
			else
			{
				act("$n tries to flee, but can't!",  
TRUE, ch, 0, 0, TO_ROOM);
			}
			return;
		}
	}
	send_to_char("PANIC!  You couldn't escape!\r\n", ch);
}

Cat@NoMUD.



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