v0.6.3: fixed crash bugs caused by tile discovery

This commit is contained in:
Evan Debenham 2018-01-08 18:30:06 -05:00
parent a4e9e10f6d
commit 4d6fdad4ea
2 changed files with 4 additions and 0 deletions

View File

@ -786,6 +786,7 @@ public class GameScene extends PixelScene {
} }
} }
//todo this doesn't account for walls right now
public static void discoverTile( int pos, int oldValue ) { public static void discoverTile( int pos, int oldValue ) {
if (scene != null) { if (scene != null) {
scene.tiles.discover( pos, oldValue ); scene.tiles.discover( pos, oldValue );

View File

@ -113,6 +113,9 @@ public abstract class DungeonTilemap extends Tilemap {
public void discover( int pos, int oldValue ) { public void discover( int pos, int oldValue ) {
int visual = getTileVisual( pos, oldValue, false);
if (visual < 0) return;
final Image tile = new Image( texture ); final Image tile = new Image( texture );
tile.frame( tileset.get( getTileVisual( pos, oldValue, false))); tile.frame( tileset.get( getTileVisual( pos, oldValue, false)));
tile.point( tileToWorld( pos ) ); tile.point( tileToWorld( pos ) );