mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-15 08:06:06 +09:00
dummix: fuck this shit
Former-commit-id: 7d9983b50f218611c2d482723a88851e13fca3d0 Former-commit-id: 3891c23fd13248a869f8611dc3185d2a7a564d51
This commit is contained in:
@@ -139,6 +139,8 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
|
||||
override fun call(path: LuaValue) : LuaValue {
|
||||
Filesystem.ensurePathSanity(path)
|
||||
|
||||
println("ListFiles: got path ${path.checkIBM437()}")
|
||||
|
||||
val table = LuaTable()
|
||||
val file = File(computer.getRealPath(path)).absoluteFile
|
||||
try {
|
||||
@@ -162,7 +164,10 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
|
||||
override fun call(path: LuaValue) : LuaValue {
|
||||
Filesystem.ensurePathSanity(path)
|
||||
|
||||
return LuaValue.valueOf(Files.isDirectory(Paths.get(computer.getRealPath(path)).toAbsolutePath()))
|
||||
val isDir = Files.isDirectory(Paths.get(computer.getRealPath(path)).toAbsolutePath())
|
||||
val exists = Files.exists(Paths.get(computer.getRealPath(path)).toAbsolutePath())
|
||||
|
||||
return LuaValue.valueOf(isDir || exists)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user