mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-21 00:18:43 +00:00
DBViewNumber shouldn't crash anymore.
--HG-- branch : dfighter-tools
This commit is contained in:
parent
2fe2077170
commit
b6d9e3285f
3 changed files with 21 additions and 3 deletions
|
@ -55,9 +55,7 @@ namespace NLGUI
|
|||
static void forceLink();
|
||||
|
||||
protected:
|
||||
|
||||
sint64 getVal() { if (_Modulo == 0) return (_Number.getSInt64() / _Divisor);
|
||||
else return (_Number.getSInt64() / _Divisor)%_Modulo; }
|
||||
sint64 getVal();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -47,6 +47,15 @@ namespace NLGUI
|
|||
_VolatileValue = NULL;
|
||||
}
|
||||
|
||||
/// Tells if this property has a value
|
||||
bool hasValue() const
|
||||
{
|
||||
if( _VolatileValue != NULL )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
NLMISC::CCDBNodeLeaf* getNodePtr() const
|
||||
{
|
||||
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…
Reference in a new issue