summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 21fb61c81e..87713b9b3b 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1037,18 +1037,24 @@ bool Main::start() {
if (!absolute) {
- int sep=local_game_path.find_last("/");
+ if (Globals::get_singleton()->is_using_datapack()) {
- if (sep==-1) {
- DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- local_game_path=da->get_current_dir()+"/"+local_game_path;
- memdelete(da) ;
- } else {
+ local_game_path="res://"+local_game_path;
- DirAccess *da = DirAccess::open(local_game_path.substr(0,sep));
- if (da) {
- local_game_path=da->get_current_dir()+"/"+local_game_path.substr(sep+1,local_game_path.length());;
- memdelete(da);
+ } else {
+ int sep=local_game_path.find_last("/");
+
+ if (sep==-1) {
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ local_game_path=da->get_current_dir()+"/"+local_game_path;
+ memdelete(da) ;
+ } else {
+
+ DirAccess *da = DirAccess::open(local_game_path.substr(0,sep));
+ if (da) {
+ local_game_path=da->get_current_dir()+"/"+local_game_path.substr(sep+1,local_game_path.length());;
+ memdelete(da);
+ }
}
}