mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Add more descriptive error messages
This commit is contained in:
@ -392,9 +392,15 @@ void CGameStateCampaign::transferMissingArtifacts(const CampaignTravel & travelO
|
||||
|
||||
auto * donorHero = campaignHeroReplacement.hero;
|
||||
|
||||
if (!donorHero)
|
||||
throw std::runtime_error("Failed to find hero to take artifacts from! Scenario: " + gameState->map->name.toString());
|
||||
|
||||
for (auto const & artLocation : campaignHeroReplacement.transferrableArtifacts)
|
||||
{
|
||||
auto * artifact = donorHero->getArt(artLocation);
|
||||
if (!donorHero)
|
||||
throw std::runtime_error("Failed to find artifacts to transfer to travelling hero! Scenario: " + gameState->map->name.toString());
|
||||
|
||||
artifact->removeFrom(*donorHero, artLocation);
|
||||
|
||||
if (receiver)
|
||||
|
Reference in New Issue
Block a user