Implemented the proper interaction for low-alchemy option on the Explorer's Ring
Implemented a generic item selection ContentAPI method Added ContentAPI method for running CS2 scripts Added development command for running CS2 scripts
This commit is contained in:
@@ -101,14 +101,14 @@ class ServerStore : PersistWorld {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun JSONObject.getInt(key: String): Int {
|
||||
fun JSONObject.getInt(key: String, default: Int = 0): Int {
|
||||
return when(val value = this[key]){
|
||||
is Long -> value.toInt()
|
||||
is Double -> value.toInt()
|
||||
is Float -> value.toInt()
|
||||
is Int -> value
|
||||
is Nothing -> 0
|
||||
else -> 0
|
||||
is Nothing -> default
|
||||
else -> default
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user