rocksndiamonds-3.1.2
[rocksndiamonds.git] / src / libgame / setup.c
index 967fbcfacd60a10e9f36eacfdcd74b3fbd11a3a7..3b9438e6031316e9fec7ebb2fd295c038b5f05e9 100644 (file)
@@ -302,8 +302,8 @@ char *setLevelArtworkDir(TreeInfo *ti)
   if (ti == NULL || leveldir_current == NULL)
     return NULL;
 
-  artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type));
-  artwork_set_ptr  = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type));
+  artwork_path_ptr = LEVELDIR_ARTWORK_PATH_PTR(leveldir_current, ti->type);
+  artwork_set_ptr  = LEVELDIR_ARTWORK_SET_PTR( leveldir_current, ti->type);
 
   checked_free(*artwork_path_ptr);
 
@@ -2042,6 +2042,18 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first,
 #endif
 
 #if 1
+  /* adjust some settings if user's private level directory was detected */
+  if (leveldir_new->sort_priority == LEVELCLASS_UNDEFINED &&
+      leveldir_new->in_user_dir &&
+      (strcmp(leveldir_new->subdir, getLoginName()) == 0 ||
+       strcmp(leveldir_new->name,   getLoginName()) == 0 ||
+       strcmp(leveldir_new->author, getRealName())  == 0))
+  {
+    leveldir_new->sort_priority = LEVELCLASS_PRIVATE_START;
+    leveldir_new->readonly = FALSE;
+  }
+
+#else
   /* adjust sort priority if user's private level directory was detected */
   if (leveldir_new->sort_priority == LEVELCLASS_UNDEFINED &&
       leveldir_new->in_user_dir &&