I have a bots. Each bot has Area2D and saves all bots that entered it into sensory memory as raw pointers to Node, given as argument of signal processing function:
void _on_PerceptionArea_body_entered(Node * body) {
...
}
When some bot is died, it calls queue_free() for itself.
But then I get crash because I try to access pointer to deleted bot in sensory memory.
Is it possible to check is pointer still valid? Or maybe is there a way to convert that pointer to something that will protect me from crashing?