Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Rune: the Roguelike  (Read 2343 times)

Keiseth

  • Bay Watcher
    • View Profile
Re: Rune: the Roguelike
« Reply #15 on: January 02, 2009, 12:18:26 am »

Man, I haven't used C++ in quite a few months now, I've gotta be rusty. I have a weird, insane person's way of doing this sort of thing, but if I was using a pointer, I'd make it a NULL pointer when unequipped, and only access the thing through a function that always checks to see if it's NULL or not. Since it's NULL, it won't be a dangling pointer. (Or if you're using another language, your equivalent for NULL: None in python, undefined in javascript, etc.)

Good luck on your project, Fenrir!
Logged

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: Rune: the Roguelike
« Reply #16 on: January 02, 2009, 11:41:48 am »

Man, I haven't used C++ in quite a few months now, I've gotta be rusty. I have a weird, insane person's way of doing this sort of thing, but if I was using a pointer, I'd make it a NULL pointer when unequipped, and only access the thing through a function that always checks to see if it's NULL or not. Since it's NULL, it won't be a dangling pointer. (Or if you're using another language, your equivalent for NULL: None in python, undefined in javascript, etc.)

Good luck on your project, Fenrir!
Fenrir slaps his own forehead with his front paw.

Thanks, Keiseth.
Logged
Pages: 1 [2]