Changed ActorFrame::SetUpdateRate to reject a negative rate instead of crashing.
This commit is contained in:
+10
-1
@@ -624,7 +624,16 @@ public:
|
|||||||
}
|
}
|
||||||
static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( BIArg(1) ); COMMON_RETURN_SELF; }
|
static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( BIArg(1) ); COMMON_RETURN_SELF; }
|
||||||
static int fov( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
|
static int fov( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
|
||||||
static int SetUpdateRate( T* p, lua_State *L ) { p->SetUpdateRate( FArg(1) ); COMMON_RETURN_SELF; }
|
static int SetUpdateRate( T* p, lua_State *L )
|
||||||
|
{
|
||||||
|
float rate= FArg(1);
|
||||||
|
if(rate <= 0)
|
||||||
|
{
|
||||||
|
luaL_error(L, "ActorFrame:SetUpdateRate(%f) Update rate must be greater than 0.", rate);
|
||||||
|
}
|
||||||
|
p->SetUpdateRate(rate);
|
||||||
|
COMMON_RETURN_SELF;
|
||||||
|
}
|
||||||
DEFINE_METHOD(GetUpdateRate, GetUpdateRate());
|
DEFINE_METHOD(GetUpdateRate, GetUpdateRate());
|
||||||
static int SetFOV( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
|
static int SetFOV( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
|
||||||
static int vanishpoint( T* p, lua_State *L ) { p->SetVanishPoint( FArg(1), FArg(2) ); COMMON_RETURN_SELF; }
|
static int vanishpoint( T* p, lua_State *L ) { p->SetVanishPoint( FArg(1), FArg(2) ); COMMON_RETURN_SELF; }
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ public:
|
|||||||
virtual void FinishTweening();
|
virtual void FinishTweening();
|
||||||
virtual void HurryTweening( float factor );
|
virtual void HurryTweening( float factor );
|
||||||
|
|
||||||
void SetUpdateRate( float fUpdateRate ) { m_fUpdateRate = fUpdateRate; }
|
void SetUpdateRate(float rate) { if(rate > 0.0f) { m_fUpdateRate = rate; }}
|
||||||
float GetUpdateRate() { return m_fUpdateRate; }
|
float GetUpdateRate() { return m_fUpdateRate; }
|
||||||
void SetFOV( float fFOV ) { m_fFOV = fFOV; }
|
void SetFOV( float fFOV ) { m_fFOV = fFOV; }
|
||||||
void SetVanishPoint( float fX, float fY) { m_fVanishX = fX; m_fVanishY = fY; }
|
void SetVanishPoint( float fX, float fY) { m_fVanishX = fX; m_fVanishY = fY; }
|
||||||
|
|||||||
Reference in New Issue
Block a user