Browse Source

Gernsworth's patch for bug #1118

mateuszb 13 năm trước cách đây
mục cha
commit
2848fb6fef
3 tập tin đã thay đổi với 17 bổ sung1 xóa
  1. 4 0
      client/CPlayerInterface.cpp
  2. 12 0
      client/GUIClasses.cpp
  3. 1 1
      client/NetPacksClient.cpp

+ 4 - 0
client/CPlayerInterface.cpp

@@ -1292,6 +1292,10 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path )
 			CCS->soundh->stopSound(sh);
 		}
 
+        //Update cursor so icon can change if needed when it reappears; doesn;'t apply if a dialog box pops up at the end of the movement
+        if(!showingDialog->get())
+            GH.fakeMouseMove();
+
 		//RAII unlocks
 	}
 

+ 12 - 0
client/GUIClasses.cpp

@@ -5911,8 +5911,20 @@ void CWindowWithArtifacts::artifactRemoved(const ArtifactLocation &artLoc)
 
 void CWindowWithArtifacts::artifactMoved(const ArtifactLocation &artLoc, const ArtifactLocation &destLoc)
 {
+    CArtifactsOfHero *destaoh = NULL;
 	BOOST_FOREACH(CArtifactsOfHero *aoh, artSets)
+    {
 		aoh->artifactMoved(artLoc, destLoc);
+        aoh->redraw();
+        if(destLoc.isHolder(aoh->getHero()))
+            destaoh = aoh;
+    }
+
+    //Make sure the status bar is updated so it does not display old text
+    if(destaoh != NULL)
+    {
+        destaoh->getArtPlace(destLoc.slot)->hover(true);
+    }
 }
 
 void CWindowWithArtifacts::artifactDisassembled(const ArtifactLocation &artLoc)

+ 1 - 1
client/NetPacksClient.cpp

@@ -224,7 +224,7 @@ void MoveArtifact::applyCl( CClient *cl )
 {
 	INTERFACE_CALL_IF_PRESENT(src.owningPlayer(), artifactMoved, src, dst);
 	if(src.owningPlayer() != dst.owningPlayer())
-		INTERFACE_CALL_IF_PRESENT(src.owningPlayer(), artifactMoved, src, dst);
+		INTERFACE_CALL_IF_PRESENT(dst.owningPlayer(), artifactMoved, src, dst);
 }
 
 void AssembledArtifact::applyCl( CClient *cl )