mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
client is able to erase artifact
This commit is contained in:
@@ -4063,6 +4063,23 @@ bool CGameHandler::assembleArtifacts (ObjectInstanceID heroID, ArtifactPosition
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGameHandler::eraseArtifactByClient(const ArtifactLocation & al)
|
||||
{
|
||||
const auto * hero = getHero(al.relatedObj()->id);
|
||||
if(hero == nullptr)
|
||||
COMPLAIN_RET("eraseArtifactByClient: wrong hero's ID");
|
||||
|
||||
const auto * art = al.getArt();
|
||||
if(art == nullptr)
|
||||
COMPLAIN_RET("Cannot remove artifact!");
|
||||
|
||||
if(al.getArt()->artType->canBePutAt(hero) || al.slot != ArtifactPosition::TRANSITION_POS)
|
||||
COMPLAIN_RET("Unlegal removing artifact");
|
||||
|
||||
removeArtifact(al);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGameHandler::buyArtifact(ObjectInstanceID hid, ArtifactID aid)
|
||||
{
|
||||
const CGHeroInstance * hero = getHero(hid);
|
||||
|
||||
Reference in New Issue
Block a user