This commit is contained in:
GameHerobrine 2023-01-13 01:10:17 +03:00
commit c60ccb4f1b
2 changed files with 11 additions and 2 deletions

View file

@ -21,7 +21,12 @@ class PMF{
public function create($file, $type, $version = PMF_CURRENT_VERSION){
$this->file = $file;
@mkdir(dirname($this->file), 0755, true);
$dirname = dirname($this->file);
if(!is_dir($dirname)){
@mkdir($dirname, 0755, true);
}
if(!is_resource($this->fp)){
if(($this->fp = @fopen($file, "c+b")) === false){
return false;

View file

@ -38,7 +38,11 @@ class PMFLevel extends PMF{
$this->saveData(false);
$this->locationTable = [];
$cnt = pow($this->levelData["width"], 2);
@mkdir(dirname($this->file) . "/chunks/", 0755);
$dirname = dirname($this->file) . "/chunks/";
if(!is_dir($dirname)){
@mkdir($dirname , 0755);
}
for($index = 0; $index < $cnt; ++$index){
$this->chunks[$index] = false;
$this->chunkChange[$index] = false;