There should be a 25% change someProjectile will bounce when it hits something, otherwise it will stick there until the end of its lifetime, then explode.
function someProjectile::onCollision(%this, %obj, %col, %a, %b, %c, %d) {
if(!getRandom(0, 3))
%obj.bounce();
else
parent::onCollision(%this, %obj, %col, %a, %b, %c, %d);
}
For some reason, the engine crashes when this function is called.
I suspect this is a stupidly simple problem with my use of ::bounce(), however I am unable to find out exactly what the problem is.
Could somebody please put me on the right track to fixing this.