Fixed crash in end camera - hopefully the last problem.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5634 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-07-05 00:10:58 +00:00
parent bc50f128ce
commit 6c7cdb1b7b
2 changed files with 8 additions and 4 deletions

View File

@ -399,7 +399,11 @@ void Camera::update(float dt)
*/
void Camera::handleEndCamera(float dt)
{
switch(m_end_cameras[m_current_end_camera].m_type)
EndCameraInformation::EndCameraType info
= m_end_cameras.size()==0 ? EndCameraInformation::EC_AHEAD_OF_KART
: m_end_cameras[m_current_end_camera].m_type;
switch(info)
{
case EndCameraInformation::EC_STATIC_FOLLOW_KART:
{

View File

@ -106,9 +106,9 @@ private:
EC_AHEAD_OF_KART A camera that flies ahead of the kart
always pointing at the kart.
*/
enum {EC_STATIC_FOLLOW_KART,
EC_AHEAD_OF_KART}
m_type;
typedef enum {EC_STATIC_FOLLOW_KART,
EC_AHEAD_OF_KART} EndCameraType;
EndCameraType m_type;
/** Position of the end camera. */
Vec3 m_position;