Before you call char_to_room, you need to remove them from the room they're in.

  if (ch->in_room)
      char_from_room(ch);

On 5/5/05, cyhawk <[EMAIL PROTECTED]> wrote:
> Ok.. this is rather hmm, odd.
> Im currently in the process of writing a new fight system from scratch
> (for fun, headaches, and because i want more control over the fight
> system, eh im not using rom-styled fight code, so it makes sense) anyways..
> Everything is thusfar complete. (Short of tweaking numbers, adding in
> effects like weapon knowledge, santuary etc)
> and im working on a replacement for raw_kill. Its much like a clone of
> the orginal.
> 
> the code is:
> void death_kill(CHAR_DATA * ch, CHAR_DATA * victim, bool announce, int
> to_room)
> {
>           char buf[MSL];
> 
>           // Tell them the died, or killed something
>           sprintf(buf, "{RYou have been Killed by %s!!\n\r", victim->name);
>           stc(buf, ch);
>           sprintf(buf, "{RYou have killed %s!!\n\r", ch->name);
>           stc(buf, victim);
> 
>           // Stop the fighting
>           stop_fighting(ch, TRUE);
> 
>           // Reset the charater..
> 
>           char_to_room(ch, get_room_index (50));
>           ch->position = POS_RESTING;
>           ch->hit  = 1;
>           ch->mana = 1;
>           ch->move = 1;
>           return;
> }
> 
> Granted its nothing pretty. (room 50 being my temp deathroom, since im
> not actually sure how i want to handle death, im torn between a few
> ideas, so for the time being im just gonna keep it diku-ish and put them
> back into the game with 1 hp, resting and in the starter room)
> 
> Heres the problem. I get killed by mr Puff the Fractal dragon, I 'die',
> get sent to the room, resting etc. But, the room we were fighting in
> suddenly becomes null. Its gone. I transfer there, mud stalls (not
> crashed, just loops). I can transfer Puff out of the room fine, but end
> up with this Char_from_room: ch not found. I try "at 1 look" and it too
> stalls, room 2 stat also stalls, so my only consulsion is, im croupting
> the room somehow.
> Nothing, anywhere in my fighting code deals with rooms (er yet) or any
> sort of room data, short of the char_to_room.
> Any ideas on what is going on? This one has me beat ;)
> 
> -Thri
> --
> ROM mailing list
> [email protected]
> Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>

Reply via email to