mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Workaround for glob() fail, fix worlds not loading properly on some systems, close #197
This commit is contained in:
parent
3672d60bf4
commit
1eaf7c5431
@ -210,6 +210,12 @@ class McRegion extends BaseLevelProvider{
|
||||
|
||||
if($isValid){
|
||||
$files = glob($path . "/region/*.mc*");
|
||||
if(empty($files)){ //possible glob() issue on some systems
|
||||
$files = array_filter(scandir($path . "/region/"), function($file){
|
||||
return substr($file, strrpos($file, ".") + 1, 2) === "mc"; //region file
|
||||
});
|
||||
}
|
||||
|
||||
foreach($files as $f){
|
||||
if(substr($f, strrpos($f, ".") + 1) !== static::REGION_FILE_EXTENSION){
|
||||
$isValid = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user