ID:150200
 
Hiya! I've been whipping up a little something for my Pay-to-Play section of VoV, and I've run into a little trouble.

Here's a relevant snippet, in which I'm trying to see what area they are in:
mob/proc/life()
var/marea = src.loc.loc
if(istype(marea,/area/sun)) //if they're in the sun
tancount += 10 //make them more tanned
if(istype(marea,/area/shade)) //if they're in the shade
tancount -= 10 //take some tan away

That code produces a run-time error of null.loc...
runtime error: Cannot read null.loc.
proc name: life (/mob/proc/life)
usr: the mob (/mob)
src: the mob (/mob)
call stack:
the mob (/mob): life()
the mob (/mob): New(null)


I tried using just bare src.loc.loc in the istype() arguments, but that didn't work anyway. I've also tried to compare loc.loc without istype(), but to no avail.
Vortezz wrote:
<font color=red>
> runtime error: Cannot read null.loc.
> proc name: life (/mob/proc/life)
> usr: the mob (/mob)
> src: the mob (/mob)
> call stack:
> the mob (/mob): life()
> the mob (/mob): New(null)
>
</font>

Look like you're calling this from mob/New(), before the mob's loc gets set in Login().