[gameprogrammer] Re: pointer values

  • From: Vince <uberneen@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Wed, 24 Nov 2010 08:17:32 -0800 (PST)

I suppose that depends on what you do with the pointer value.
If you're catching the 0 and not trying to cast it then I would think you would 
be fine.
I typically use light userdata for script to engine communication so the value 
is always handled based on the context anyway.

Vince~

--- On Wed, 11/24/10, Roger Durañona Vargas <luo_hei@xxxxxxxx> wrote:

> From: Roger Durañona Vargas <luo_hei@xxxxxxxx>
> Subject: [gameprogrammer] pointer values
> To: gameprogrammer@xxxxxxxxxxxxx
> Date: Wednesday, November 24, 2010, 10:27 AM
>  In my game I have found a problem
> implementing the AI. I have some Lua
> scripts that request the entity instances from the host
> application and
> receive the instance as a pointer. I found that I need a
> way to signal
> the scrit that such entity no longer exists (for example,
> was killed).
> My question is, is it safe to return 0 as pointer value to
> tell the
> script that such entity no longer exists?
> 
> -- 
> Roger D. Vargas
> Using Gentoo Linux 2010, Ogre 1.7.1
> Powered by Core 2 Duo E8400 3.0GHz, 2Gb RAM, Radeon HD5770
> http://gpnfn.blogspot.com, The news for game
> programming newbies
> 
> 
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> 
> 
> 




---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: