Bullet shower demo crashed because of dynamic casting in the code for object picking. Making sure the object has an ID greater than 0 before typecasting solves it.

This commit is contained in:
TheoXD 2015-04-03 14:42:05 +02:00
parent 9fa1698c74
commit 68c2a959dd

View file

@ -406,7 +406,7 @@ void Viewport::_notification(int p_what) {
int rc = ss2d->intersect_point(point,res,64,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
for(int i=0;i<rc;i++) {
if (res[i].collider) {
if (res[i].collider_id && res[i].collider) {
CollisionObject2D *co=res[i].collider->cast_to<CollisionObject2D>();
if (co) {