Merge pull request #2763 from kevlahnota/newmaster2

fix blackscreen
This commit is contained in:
Anthony Calosa
2023-03-27 13:27:13 +08:00
committed by GitHub
2 changed files with 11 additions and 9 deletions

View File

@@ -191,8 +191,6 @@ public class MapActor extends Actor {
}
public boolean collideWithPlayer(PlayerSprite other) {
boolean newIsColliding = collideWith(other);
if (newIsColliding) {
if (!isCollidingWithPlayer)
@@ -205,6 +203,8 @@ public class MapActor extends Actor {
}
public boolean collideWith(Rectangle other) {
if (getCollisionHeight() == 0f)
return false;
return boundingRect().overlaps(other);
}

View File

@@ -22,20 +22,22 @@ public class MapSprite extends Actor {
static public int BackgroundLayer = -1;
static public int SpriteLayer = 0;
TextureRegion texture;
TextraLabel searchPost;
TextraLabel searchPost = Controls.newTextraLabel("[%80][+SearchPost]");
boolean isCaveDungeon, isOldorVisited;
PointOfInterest poi;
public MapSprite(Vector2 pos, TextureRegion sprite, PointOfInterest point) {
poi = point;
isCaveDungeon = point != null && (point.getData().type.equalsIgnoreCase("cave") || point.getData().type.equalsIgnoreCase("dungeon"));
isOldorVisited = poi != null && WorldSave.getCurrentSave().getPointOfInterestChanges(poi.getID() + poi.getData().map).hasDeletedObjects();
searchPost = Controls.newTextraLabel("[%80][+SearchPost]");
if (point != null) {
isCaveDungeon = "cave".equalsIgnoreCase(point.getData().type) || "dungeon".equalsIgnoreCase(point.getData().type);
if (point.getData().map != null && point.getID() != null) {
isOldorVisited = WorldSave.getCurrentSave().getPointOfInterestChanges(point.getID() + point.getData().map).hasDeletedObjects();
}
}
texture = sprite;
setPosition(pos.x, pos.y);
setHeight(texture.getRegionHeight());
setWidth(texture.getRegionWidth());
setWidth(texture.getRegionWidth());
}
public void checkOut() {
isOldorVisited = true;
}