c++ - Objects Colliding -


i creating function checks if cars colliding , if speed reduced. works different car types not when same car type hits same car type both stop

this method being called timer.

basically if car hits carwithtrailer car slows down.

but if car hits car both stop because same object.

---> last logic in if statement problem

            !(typeid(*(colliding_items2[i]))==  typeid(this)) 

      qlist<qgraphicsitem *> colliding_items2 = collidingitems(); for(int i=0, n= colliding_items2.size();i<n;++i){     if(((typeid(*(colliding_items2[i]))== typeid(carwithtrailer)) ||(typeid(*(colliding_items2[i]))== typeid(car)) ) && (!(typeid(*(colliding_items2[i]))==  typeid(this)) )){       speedofcar = speedofcar-1;         return;   } } 

i want check if hitting same object type wont stop.

any appreciated.


Comments

Popular posts from this blog

SQL php on different pages to Insert (mysqli) -

How to combine associative arrays in bash? -

c++ - No viable overloaded operator for references a map -