DBViewNumber shouldn't crash anymore.

--HG--
branch : dfighter-tools
hg/compatibility
dfighter1985 10 years ago
parent 2fe2077170
commit b6d9e3285f

@ -55,9 +55,7 @@ namespace NLGUI
static void forceLink(); static void forceLink();
protected: protected:
sint64 getVal();
sint64 getVal() { if (_Modulo == 0) return (_Number.getSInt64() / _Divisor);
else return (_Number.getSInt64() / _Divisor)%_Modulo; }
protected: protected:

@ -47,6 +47,15 @@ namespace NLGUI
_VolatileValue = NULL; _VolatileValue = NULL;
} }
/// Tells if this property has a value
bool hasValue() const
{
if( _VolatileValue != NULL )
return true;
else
return false;
}
NLMISC::CCDBNodeLeaf* getNodePtr() const NLMISC::CCDBNodeLeaf* getNodePtr() const
{ {
return _VolatileValue; return _VolatileValue;

@ -249,5 +249,16 @@ namespace NLGUI
{ {
} }
sint64 CDBViewNumber::getVal()
{
if( !_Number.hasValue() )
return 0;
if( _Modulo == 0 )
return _Number.getSInt64() / _Divisor;
else
return ( _Number.getSInt64() / _Divisor ) % _Modulo;
}
} }

Loading…
Cancel
Save