Merge pull request #14821 from ibrahn/fnt-load-root-fix

BitmapFont::create_from_fnt loading file from project root.
This commit is contained in:
Rémi Verschelde 2017-12-19 12:53:41 +01:00 committed by GitHub
commit 49eea481ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -257,8 +257,8 @@ Error BitmapFont::create_from_fnt(const String &p_file) {
if (keys.has("file")) {
String file = keys["file"];
file = p_file.get_base_dir() + "/" + file;
String base_dir = p_file.get_base_dir();
String file = base_dir.plus_file(keys["file"]);
Ref<Texture> tex = ResourceLoader::load(file);
if (tex.is_null()) {
ERR_PRINT("Can't load font texture!");