Re: bug..?

From: George Greer (
Date: 04/09/99

On Fri, 9 Apr 1999, Nocturnal Occulto wrote:

>How do I check if the mob is really thwere then?
>Sorry for the wierd questions but I cant really understand this..
>I thought a pointer contained a integer refering to what it is pointing on,
>when u check the pointer for = NULL it went to the memory area pointed to
>and checked if that area was NULL, so If the area is a mob and I clear the
>mob wouldnt that area be NULL?
>Hope Im making sence :)


   v    The data way below may be free()'d by someone else with a pointer
        to 0x1234 also.  Just because you have a pointer somewhere doesn't
   v    mean that it is actually valid.  If that were the case, setting
        ptr = 0 and then dereferencing it would work.  So if you want to
   v    see if the data is still at the address you have a pointer to, you
        must have other methods, depending entirely on what you do.

   v    As such, I cannot answer how you detect if the mob is gone.  The
        function mag_damage() returns the amount of damage done or -1
   v    if the person died.  That is its alternate way to say the data
        is gone.  Garbage collection typically removes most of this talk.
[0x1234:Data is here.]

George Greer, | Genius may have its limitations, but     | stupidity is not thus handicapped.  |                  -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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