Fix player marker updating when players layer is hidden

This commit is contained in:
James Lyne 2021-08-22 23:04:07 +01:00
parent ca9009e33f
commit 31938d530a

View File

@ -94,7 +94,7 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
var markerPosition = dynmap.getProjection().fromLocationToLatLng(player.location); var markerPosition = dynmap.getProjection().fromLocationToLatLng(player.location);
player.marker.setLatLng(markerPosition); player.marker.setLatLng(markerPosition);
// Update health // Update health
if (configuration.showplayerhealth) { if (configuration.showplayerhealth && player.healthContainer) {
if (player.health !== undefined && player.armor !== undefined) { if (player.health !== undefined && player.armor !== undefined) {
player.healthContainer.css('display','block'); player.healthContainer.css('display','block');
player.healthBar.css('width', Math.ceil(player.health*2.5) + 'px'); player.healthBar.css('width', Math.ceil(player.health*2.5) + 'px');