ayoub05 / vdrift-ogre

Automatically exported from code.google.com/p/vdrift-ogre
0 stars 0 forks source link

Editor crash when pressing "next road point" key when there is no road #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load any track.
2. Delete the road.
3. Go into road edit mode.
4. Press the key for next road point (e.g. mouse wheel) 

Does this happen every time?
 - Yes.

What is the expected output? What do you see instead?
 - Expected: nothing should happen, because there is no road.
 - What happens: crash.

Program received signal SIGFPE, Arithmetic exception.
0x00000000004cc5f8 in SplineRoad::PrevPoint (this=0x23409f0)
    at /home/scrawl/Entwicklung/StuntRally/source/road/Road_Edit.cpp:358
358     iChosen = (iChosen-1 + getNumPoints()) % getNumPoints();

You have to check if NumPoints is 0 before doing this calculation.

Original issue reported on code.google.com by scrawl...@gmail.com on 10 Apr 2011 at 12:51

GoogleCodeExporter commented 9 years ago

Original comment by scrawl...@gmail.com on 10 Apr 2011 at 12:52

GoogleCodeExporter commented 9 years ago
Fix in hg.

Original comment by scrawl...@gmail.com on 10 Apr 2011 at 12:55

GoogleCodeExporter commented 9 years ago

Original comment by Cry...@gmail.com on 8 May 2011 at 1:46