ID:264482
 
Code:
mob
var
image/Box = null

mob/verb
ShowImage()
// Show an image and place it over src.
// See if it changes direction and flicks motion.
src.Box = image ('mobimage.dmi', src)
src << src.Box

DeleteImage()
world << "Box is " << src.Box
var/client/C = src.client // This is the error line!
C.images -= src.Box


turf
icon='turf.dmi'


Problem description:

ShowImage verb works fine. But when I click the DeleteImage verb I get this runtime error.

runtime error: Cannot read null.client
proc name: DeleteImage (/mob/verb/DeleteImage)
source file: testdemo.dm,14
usr: Guest-1649440025 (/mob)
src: Guest-1649440025 (/mob)
call stack:
Guest-1649440025 (/mob): DeleteImage()

The thing that I don't get is it says right in the error message that src = /mob (me). Can some one please explain why this is happening?
How are you calling DeleteImage()?
In response to Popisfizzy
Popisfizzy wrote:
How are you calling DeleteImage()?

I'm just clicking it in the statpanel.
In response to Green Lime
I have no idea if this is related to the problem, but you're doing this:
// This is C/C++ style output (obviously excluding 'world').
world << "foo" << "bar"

// This is how you'd do it in DM.
world << "foo" + "bar"

Also, explicitly output src and see if you get a value.
In response to Popisfizzy
Popisfizzy wrote:
I have no idea if this is related to the problem, but you're doing this:
> // This is C/C++ style output (obviously excluding 'world').
> world << "foo" << "bar"
>
> // This is how you'd do it in DM.
> world << "foo" + "bar"
>

Also, explicitly output src and see if you get a value.

Thanks Popisfizzy that was the problem.