change: Fixed some tests and alternate implementations

This commit is contained in:
Nicholas Novak
2023-11-18 19:47:09 -08:00
parent 70879ec312
commit 42cad2cecc
4 changed files with 58 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
package loading
import (
"path/filepath"
"strconv"
"strings"
@@ -20,7 +21,7 @@ func LoadRegionFile(fileName string) ([]world.ChunkData, error) {
defer regionFile.Close()
// Parse the name of the region to find its position within the world
nameParts := strings.Split(fileName, ".")
nameParts := strings.Split(filepath.Base(fileName), ".")
regionX, err := strconv.Atoi(nameParts[1])
if err != nil {
return nil, err