This commit is contained in:
MihailRis
2025-11-16 18:35:04 +03:00
parent 2a8fa4f2fa
commit 536035441a
5 changed files with 26 additions and 3 deletions
+9
View File
@@ -5,6 +5,7 @@
#include "engine/Engine.hpp"
#include "engine/EnginePaths.hpp"
#include "io/io.hpp"
#include "io/devices/MemoryDevice.hpp"
#include "io/devices/ZipFileDevice.hpp"
#include "util/stringutil.hpp"
#include "api_lua.hpp"
@@ -49,6 +50,14 @@ static bool is_writeable(const std::string& entryPoint) {
if (entryPoint.substr(0, 2) == "W.") {
return true;
}
// todo: do better
auto device = io::get_device(entryPoint);
if (device == nullptr) {
return false;
}
if (dynamic_cast<io::MemoryDevice*>(device.get())) {
return true;
}
if (writeable_entry_points.find(entryPoint) != writeable_entry_points.end()) {
return true;
}