1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Implemented configurable blacksmith. Deprecated ballistaYard type

This commit is contained in:
Ivan Savenko
2024-08-23 15:29:47 +00:00
parent 175f6716d2
commit 8ef8ffa5c4
26 changed files with 85 additions and 73 deletions

View File

@ -2798,8 +2798,7 @@ bool CGameHandler::buyArtifact(ObjectInstanceID hid, ArtifactID aid)
const int price = art->getPrice();
COMPLAIN_RET_FALSE_IF(getPlayerState(hero->getOwner())->resources[EGameResID::GOLD] < price, "Not enough gold!");
if ((town->hasBuilt(BuildingID::BLACKSMITH) && town->town->warMachine == aid)
|| (town->hasBuilt(BuildingSubID::BALLISTA_YARD) && aid == ArtifactID::BALLISTA))
if(town->isWarMachineAvailable(aid))
{
giveResource(hero->getOwner(),EGameResID::GOLD,-price);
return giveHeroNewArtifact(hero, art);