瀏覽代碼

CTradeWindow: avoid crash when right click on artifact

Fix suggested by @argarak in PR #199
Arseniy Shestakov 9 年之前
父節點
當前提交
faae305ec0
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      client/windows/CTradeWindow.cpp

+ 2 - 1
client/windows/CTradeWindow.cpp

@@ -268,8 +268,9 @@ void CTradeWindow::CTradeableItem::clickRight(tribool down, bool previousState)
 			break;
 		case ARTIFACT_TYPE:
 		case ARTIFACT_PLACEHOLDER:
+			//TODO: it's would be better for market to contain actual CArtifactInstance and not just ids of certain artifact type so we can use getEffectiveDescription.
 			if(id >= 0)
-				adventureInt->handleRightClick(hlp->getEffectiveDescription(), down);
+				adventureInt->handleRightClick(CGI->arth->artifacts[id]->Description(), down);
 			break;
 		}
 	}