Okay here is the code I'm working with:

/*
*Airmail code by Trithemius - [EMAIL PROTECTED]
*/

#if defined(macintosh)
#include <types.h>
#include <time.h>
#else
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "merc.h"
#include "interp.h"

DECLARE_DO_FUN(do_look);

static char * const dir_name []  =
{
    "north", "east", "south", "west", "up", "down", "ne", "nw", "se", "sw"
};

#define MAX_SPECTATORS 100

bool check_punt_dir(CHAR_DATA* ch, ROOM_INDEX_DATA* to_room, EXIT_DATA*
pexit)
{
    /* impassable door*/
return !(IS_SET(pexit->exit_info, EX_CLOSED) &&
    (!IS_AFFECTED(ch, AFF_PASS_DOOR) || IS_SET(pexit->exit_info,EX_NOPASS)))
||
    /* unenterable room */
       (!is_room_owner(ch,to_room) && room_is_private(to_room)) ||
    /* elemental difficulties.. */
       ((to_room->sector_type == SECT_AIR ||
         to_room->sector_type == SECT_WATER_NOSWIM)
         && !IS_AFFECTED(ch,AFF_FLYING));
}

void punt_damage(CHAR_DATA* ch, CHAR_DATA* victim, int num)
{
 /* Make the damage depend on the force of the throw and how far flown */
 int amount = number_range(5 * victim->size, 5 * victim->size * (num + 1));

 WAIT_STATE(ch, PULSE_VIOLENCE);
 damage(ch,victim, amount, TYPE_UNDEFINED, DAM_BASH, FALSE);
 check_killer(ch, victim);
}

void punt_char(CHAR_DATA *ch, CHAR_DATA *victim, int door, CHAR_DATA* lst[],
int* spectator_count, int num)
{
   ROOM_INDEX_DATA *in_room;
   ROOM_INDEX_DATA *to_room;
   EXIT_DATA *pexit;
   CHAR_DATA* target;
   int s;

/*
   in_room = ch->in_room;
*/
   in_room = victim->in_room;
   pexit = in_room->exit[door];

   if(pexit)
   {
    to_room = pexit->u1.to_room;
   }

   /* End of the line */
   if(num <= 0)
   {
    /* It didn't go far..  */
   if(in_room == ch->in_room)
   {
    act("{CWith a mighty heave you throw {Y$M {C$T.{x", ch, victim,
dir_name[door], TO_CHAR);
    act("{CWith a mighty heave {B$n throws {M$N {Cinto the air!{x", ch,
NULL, victim, TO_ROOM);
   }

   act("{R$n {Clands in an unceremonious heap.{x",
    victim, NULL, NULL, TO_ROOM);
   act("{CYou hear a confused racket as {R$N {Ccompletes $S erstwhile
journey.",
    ch, NULL, victim, TO_CHAR);
      send_to_char("{RYour journey is suddenly arrested by the
floor.{x\n\r", victim);

   /* Keep the spectators informed.. */
   for(s = 0; s < *spectator_count; s++)
   {
    act("{CYou hear a confused racket as {R$N {Ccompletes $S erstwhile
journey.{x",
     lst[s], NULL, victim, TO_CHAR);
   }

   punt_damage(ch, victim, num);
   }
   else if(pexit == NULL || to_room == NULL)
   {
    /* It didn't go far..  */
   if(in_room == ch->in_room)
   {
    act("{CWith a mighty heave you throw {R$M {C$T.{x", ch, victim,
dir_name[door], TO_CHAR);
    act("With a mighty heave $n throws $N into the air!", ch, NULL, victim,
TO_ROOM);
   }

   act("{R$n {Ccrashes into the wall and lands in a disgruntled heap.{x",
victim, NULL, NULL, TO_ROOM);
      send_to_char("{W*{RCRUNCH{W* {Cis the sound of you bouncing.{x\n\r",
victim);

   if(in_room == ch->in_room)
   {
    act("{W*{RCRUNCH{W* {Cis the sound of {Y$N {Cbouncing.{x", ch, NULL,
victim, TO_CHAR);
   }
   else
   {
    act("{CYou hear a confused racket as {Y$N {Ccompletes $S erstwhile
journey.{x",
     ch, NULL, victim, TO_CHAR);

    /* Keep the spectators informed.. */
    for(s = 0; s < *spectator_count; s++)
    {
     act("{CYou hear a confused racket as {Y$N {Ccompletes $S erstwhile
journey.{x",
      lst[s], NULL, victim, TO_CHAR);
    }
   }

   punt_damage(ch, victim, num);
   }
   else if(!check_punt_dir(ch, to_room, pexit))
   {
   act("{R$n {Cgets a physics lesson from the $d and lands in a disgruntled
heap.{x", victim, NULL, pexit->keyword, TO_ROOM);
      act("{ROWCH{W! {Cis the sound of you missing the $d.{x", victim, NULL,
pexit->keyword, TO_CHAR);

   if(in_room == ch->in_room)
   {
    act("{WOoooh{R!  {CWith a neato crunch {R$N {Cbounced!{x", ch, NULL,
victim, TO_CHAR);
   }
   else
   {
    act("{CYou hear a confused racket as {Y$N {Ccompletes $S erstwhile
journey.{x",
     ch, NULL, victim, TO_CHAR);

    /* Keep the spectators informed.. */
    for(s = 0; s < *spectator_count; s++)
    {
     act("{CYou hear a confused racket as {Y$N {Ccompletes $S erstwhile
journey.{x",
      lst[s], NULL, victim, TO_CHAR);
    }
   }

   punt_damage(ch, victim, num);
   }
   else
   {
      if(ch->fighting != NULL)
      {
         stop_fighting(ch, TRUE);
         if(ch->position == POS_FIGHTING)
         {
            ch->position = POS_STANDING;
         }
      }

   /* only way to tell if this is the initial throw or not */
   if(in_room == ch->in_room)
   {
    act("{CWith a mighty heave you throw {R$M {C$T.{x", ch, victim,
dir_name[door], TO_CHAR);
    act("{CWith a mighty heave {Y$n {Cthrows {R$N {Cinto the air!{x", ch,
NULL, victim, TO_ROOM);

    /* First time through?  Add spectators in this room */
    target = in_room->people;
    while(target && *spectator_count < MAX_SPECTATORS)
    {
     if(target != ch && target != victim)
     {
    lst[(*spectator_count)++] = target;
     }

     target = target->next_in_room;
    }
   }
   else
   {
    /* This one to the player only, to cut down on spam  */
    act("{CYou hear swooshing noises to the {B$T{C.{x", ch, victim,
dir_name[door], TO_CHAR);
   }


      act("{Y$n {Ccuts a perfect arc as $E sails $T.{x", victim, NULL,
dir_name[door], TO_ROOM);
      char_from_room(victim);
      char_to_room(victim, to_room);

   act("{CIn a swoosh of air {R$n {Csails in looking quite confused.{x",
victim, NULL, NULL, TO_ROOM);
      do_look(victim, "auto");

   /* Figure collisions */
   target = to_room->people;
   while(target)
   {
    /* Hm. */
    if(target == victim)
    {
     target = target->next_in_room;
     continue;
    }

    if((target->size + victim->size) * 10 > number_range(0, 200))
    {
     /* They collide, and a fight ensues */
     act("{R$n {Csmashes headlong into {Y$N{C!{x", victim, NULL, target,
TO_ROOM);
     act("{CYou smash into {R$N{C!{x", victim, NULL, target, TO_CHAR);
     act("{R$n {Ccrashes into you!{x", victim, NULL, target, TO_VICT);
     act("{CThere is a confused shriek as the {Y$N {Ccrashes into
someone.{x", ch, NULL, victim, TO_CHAR);

     /* Keep the spectators informed.. */
     for(s = 0; s < *spectator_count; s++)
     {
      act("{CThere is a confused shriek as the {Y$N {Ccrashes into
someone.{x", lst[s], NULL, victim, TO_CHAR);
     }

     punt_damage(victim, target, num);
     punt_damage(target, victim, num);
     break;
    }

    target = target->next_in_room;
   }

   if(!target)
   {
      /* Add spectators in this room */
    target = to_room->people;
    while(target && *spectator_count < MAX_SPECTATORS)
    {
     if(target != ch && target != victim)
     {
    lst[(*spectator_count)++] = target;
     }
     target = target->next_in_room;
    }

    /* recurse to keep going */
    punt_char(ch, victim, door, lst, spectator_count, num - 1);
   }
   }

   return;
}

void do_punt(CHAR_DATA *ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim = NULL;
 char* tmp;
 int door;
 int force = 3;
 CHAR_DATA* lst[MAX_SPECTATORS];
 int spectator_count = 0;

 /* Get a victim */
    tmp = one_argument(argument,arg);
    victim = get_char_room(ch, arg);
 if (victim == NULL)
 {
  send_to_char("{MUm, punt -who-?{x\n\r",ch);
  return;
 }

 /* Figure out how far we can throw this sucker */
 /* Heavily weighted for physical size */
 force = URANGE(0,
             (get_curr_stat(ch, STAT_STR) / 5) - ((victim->size - ch->size)
* 2),
       5);

 /* Heh, not very far at all.. */
 if(force <= 0)
 {
  /* Oops, ya done pissed 'em off */
  send_to_char("{CYou grunt and heave but they refuse to budge!{x\r\n", ch);
  damage(ch,victim,0,TYPE_UNDEFINED,DAM_BASH,FALSE);
  return;
 }

 /* Get a direction or pick one.. */
    one_argument(tmp, arg);
 if(arg[0] == '\0') door = number_door();
    if ( !str_cmp( arg, "n" ) || !str_cmp( arg, "north" ) ) door = 0;
    else if ( !str_cmp( arg, "e" ) || !str_cmp( arg, "east"  ) ) door = 1;
    else if ( !str_cmp( arg, "s" ) || !str_cmp( arg, "south" ) ) door = 2;
    else if ( !str_cmp( arg, "w" ) || !str_cmp( arg, "west"  ) ) door = 3;
    else if ( !str_cmp( arg, "u" ) || !str_cmp( arg, "up"    ) ) door = 4;
    else if ( !str_cmp( arg, "d" ) || !str_cmp( arg, "down"  ) ) door = 5;
 else if ( !str_cmp( arg, "ne" ) || !str_cmp( arg, "northeast"  ) ) door =
6;
    else if ( !str_cmp( arg, "nw" ) || !str_cmp( arg, "northwest"  ) ) door
= 7;
    else if ( !str_cmp( arg, "se" ) || !str_cmp( arg, "southeast"  ) ) door
= 8;
    else if ( !str_cmp( arg, "sw" ) || !str_cmp( arg, "southwest"  ) ) door
= 9;
    else door = number_door();

 punt_char(ch, victim, door, lst, &spectator_count, force);
}
/* End of punt.c */

     And of course I've added to command.h and interp.c. (running olc 2.1)

                            Dantin

----- Original Message -----
From: "Jamie Harrell" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, December 02, 2001 1:11 PM
Subject: Re: Interpretting a Stackdump?


Um, to get a plain english, you run an operating system that'll dump a core
;)

A stackdump is nothing more than addresses in a lot of cases, and that's
rather
worthless (for MOST people) when debugging....

If you think your punt command is at fault, perhaps you should walk over it
step
by step making sure everything makes sense, and then, and only then, if it's
still
crashing, send a copy to us so we could see if that is what's at fault or
not....

Without some code, a stackdump is rather pointless, but A+ for effort ;)

Icechild
Coder of Arthanox

*********** REPLY SEPARATOR  ***********

On 12/2/2001 at 12:29 PM Stainless wrote:

>How in the heck do you get a plain english version of a stackdump that
>occurs when the mud crashes? Starting to erk me. Okay heres what happened
>and I can reproduce the problem.
>
>      1) I used the command "airmail" which is now affectionately called
>"punt", to throw a fido north which worked fine.
>
>      2) I transfered another fido and "punt fido n" into the other fido so
>they could duke it out.
>
>     3) end result a stackdump, (I can't see the log file because this file
>isn't generated for win32 ports)
>
>Stackdump:
>
>Exception: STATUS_ACCESS_VIOLATION at eip=00442A20
>eax=00000000 ebx=0A30ED00 ecx=0000004E edx=6109BB08 esi=0A30ED30
>edi=00000017
>ebp=0022E3A4 esp=0022D164 program=E:\Rom24\area\rom.exe
>cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
>Stack trace:
>Frame     Function  Args
>0022E3A4  00442A20  (0A35D05C, 0A30ED30, 00000017, FFFFFFFF)
>0022E3E4  0049A6D8  (0A35D05C, 0A30ED30, 00000004, 7700545F)
>0022E424  0049AFB7  (0A35D05C, 0A30ED30, 00000000, 0022E4C4)
>0022E474  0049B25E  (0A35D05C, 0A30ED30, 00000000, 0022E4C4)
>0022E754  0049B6D7  (0A35D05C, 0A35C632, 0A151DB0, 0022E794)
>0022E994  00450C02  (0A35D05C, 0A35C62D, 00000000, 0022E95C)
>0022FDD4  0042E2EF  (0A35C210, 0A35C62D, 0022FE54, 0042FD61)
>0022FE54  0042FD2F  (00000004, 0042F5E4, 0022FEA4, 0042F753)
>0022FEA4  0042F75C  (00000002, 0A010E58, 0A010278, 00000000)
>0022FF10  61003FA2  (00000000, 00000000, BAC62C38, 000004C0)
>0022FF40  610041B9  (0042F624, 00000000, E1C9EE28, 00000003)
>0022FF60  610041F8  (00000000, 00000000, 811F8F30, 00000005)
>0022FF90  0049C597  (0042F624, FFFFFFFF, 80430C77, 00000000)
>0022FFC0  0040103D  (00000000, 00000000, 7FFDF000, 00000000)
>0022FFF0  77E992A6  (00401000, 00000000, 000000C8, 00000100)
>End of stack trace
>
>I would assume it deals with the punt command but not sure. Is there a
>Cygwin prog that translates the stackdump? If so what is the command and
>usage? Thanks for your help.
>
>                             Dantin
>
>
>
>--
>ROM mailing list
>[email protected]
>http://www.rom.org/cgi-bin/mailman/listinfo/rom




--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom


Reply via email to