Re: [LONG] Help...

From: Sammy (samedi@dhc.net)
Date: 02/18/97


On Tue, 18 Feb 1997, melen wrote:

> I've coded in room flags for underwater, lava, etc... and would like the
> player to take damage every tick if certain things aren't satisfied. For
> instance, for underwater I've created a WATERBREATH flag for obj's. Works
> fine. But for some reason my 'hurt' code crashes. Nothing of use in GDB.
> Here's my point_update:

>     if ((SECT(i->in_room) == SECT_UNDERWATER) && !can_underwater(i) && GET_LEVEL(i) < LVL_GOD && !IS_NPC(i)) {
>      ^^^^^^^^^^^^^^^^^^^^ *This is the line it crashes on!*

Nothing useful in gdb?  Shame! :)

It's telling you exactly where you made your mistake.  You're trying to
check the player's current room etc when you've already killed them.  If
they're dead, they're extracted and no longer exist, so they can't be in
any room.

Try "print *i" in gdb, which will show you the contents of the struct
pointed to i, or in your case, will say something like "address out of
bounds".

Sam

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



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