Let luaAsInt() return sensible values for non-numeric data.
This commit is contained in:
@@ -24,6 +24,10 @@ public final class LBoolean extends LValue {
|
||||
return m_value;
|
||||
}
|
||||
|
||||
public final int luaAsInt() {
|
||||
return m_value? 1: 0;
|
||||
}
|
||||
|
||||
public final static LBoolean valueOf(boolean value) {
|
||||
return value? TRUE: FALSE;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ public class LValue {
|
||||
|
||||
/** Return value as an integer */
|
||||
public int luaAsInt() {
|
||||
luaUnsupportedOperation();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user