Open
Conversation
Collaborator
|
I have noticed that I have a more proper fix that doesn't completely remove the map view tile updates locally that I didn't push upstream, could you test if this fixes the issue? From cd3fdc24a85a8c7c6911724c18962a26c0dd3267 Mon Sep 17 00:00:00 2001
From: Kamil Chojnowski <contact@diath.net>
Date: Thu, 24 Sep 2020 14:08:07 +0200
Subject: [PATCH] Fix minimap tiles with walking creatures being reset under
some circumstances
---
src/client/creature.cpp | 2 +-
src/client/map.cpp | 10 ++++++----
src/client/map.h | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/client/creature.cpp b/src/client/creature.cpp
index ca1a4cab..308ae337 100644
--- a/src/client/creature.cpp
+++ b/src/client/creature.cpp
@@ -737,7 +737,7 @@ void Creature::updateWalkingTile()
// recache visible tiles in map views
if(newWalkingTile->isEmpty())
- g_map.notificateTileUpdate(newWalkingTile->getPosition());
+ g_map.notificateTileUpdate(newWalkingTile->getPosition(), true);
}
m_walkingTile = newWalkingTile;
}
diff --git a/src/client/map.cpp b/src/client/map.cpp
index 79312336..05c69f96 100644
--- a/src/client/map.cpp
+++ b/src/client/map.cpp
@@ -31,7 +31,7 @@ void Map::setMapView(const MapViewPtr &view)
m_mapView = view;
}
-void Map::notificateTileUpdate(const Position& pos)
+void Map::notificateTileUpdate(const Position& pos, const bool ignoreMinimap/* = false*/)
{
if(!pos.isMapPosition())
return;
@@ -40,9 +40,11 @@ void Map::notificateTileUpdate(const Position& pos)
m_mapView->onTileUpdate(pos);
}
- LocalPlayerPtr localPlayer = g_game.getLocalPlayer();
- if (localPlayer && (localPlayer->getFakePosition().z == pos.z || localPlayer->getPosition().z == pos.z)) {
- g_minimap.updateTile(pos, getTile(pos));
+ if (!ignoreMinimap) {
+ LocalPlayerPtr localPlayer = g_game.getLocalPlayer();
+ if (localPlayer && (localPlayer->getFakePosition().z == pos.z || localPlayer->getPosition().z == pos.z)) {
+ g_minimap.updateTile(pos, getTile(pos));
+ }
}
}
diff --git a/src/client/map.h b/src/client/map.h
index f87e0a3f..8b61d893 100644
--- a/src/client/map.h
+++ b/src/client/map.h
@@ -67,7 +67,7 @@ class Map
void terminate();
void setMapView(const MapViewPtr &view);
- void notificateTileUpdate(const Position& pos);
+ void notificateTileUpdate(const Position& pos, const bool ignoreMinimap = false);
bool loadOtcm(const std::string& fileName);
void saveOtcm(const std::string& fileName); |
Contributor
|
From my tests solution proposed by @diath; is better, but I have a lot of changes on my fork that could also influence minimap behavior. |
Contributor
Author
|
Btw, this issue seems to be somewhat hardware/(other)software dependent. On new laptop and different linux version it seems like I can't easily reproduce it XD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.