Browse Source

add reinterpret type check

ncannasse 7 years ago
parent
commit
af4973c92e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      hxd/res/Loader.hx

+ 4 - 1
hxd/res/Loader.hx

@@ -37,7 +37,10 @@ class Loader {
 			res = Type.createInstance(c, [entry]);
 			currentInstance = old;
 			cache.set(path, res);
-		}
+		} else {
+			if( Std.instance(res,c) == null )
+				throw path+" has been reintrepreted from "+Type.getClass(res)+" to "+c;
+		}			
 		return res;
 	}