Game Development Community

SimGroups do not call

by Bryan Edds · in Torque Game Engine · 01/08/2005 (1:18 am) · 2 replies

SimGroups do not call '::onRemove(%this)' or '::delete(%this)' on the objects added to them when they delete those objects. I know that all objects that are added to a SimGroup are deleted when the containing SimGroup is deleted, but it seems like SimGroups is doing only part of the job when deleting its objects.

To me, this is incorrect behavior. All SimObjects are supposed to have their '::onRemove(%this)' method called when they are deleted. And since I often override the '::delete(%this)' method, I would prefer for SimGroups to delete them using that method call instead of whatever in the world it is doing now. Is there a reason that objects added to SimGroups are deleted without having the necessary calls made to them?

If this is indeed ill-behavior, then my solution would be to redefine how SimGroups delete their objects in the engine. I'm not exactly sure how I'd go about it, but I should be able to figure it out pretty quickly.

Any help, comments, or thoughts would be appreciated.

#1
01/09/2005 (10:04 pm)
Good point. I'll look at this.
#2
03/14/2005 (11:02 pm)
Just checked, and SimGroups do call unregisterObject when they delete their children, which ALWAYS calls onRemove - so it might be an object-specific issue that the object isn't issuing a script callback properly.