1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

manageBackpackArtifacts

This commit is contained in:
SoundSSGood
2024-09-26 13:47:26 +03:00
parent f816c3306b
commit e22d15b1d8
7 changed files with 89 additions and 27 deletions

View File

@@ -197,22 +197,7 @@ void ApplyGhNetPackVisitor::visitManageBackpackArtifacts(ManageBackpackArtifacts
gh.throwIfPlayerNotActive(&pack);
if(gh.getPlayerRelations(pack.player, gh.getOwner(pack.artHolder)) != PlayerRelations::ENEMIES)
{
if(pack.cmd == ManageBackpackArtifacts::ManageCmd::SCROLL_LEFT)
result = gh.scrollBackpackArtifacts(pack.player, pack.artHolder, true);
else if(pack.cmd == ManageBackpackArtifacts::ManageCmd::SCROLL_RIGHT)
result = gh.scrollBackpackArtifacts(pack.player, pack.artHolder, false);
else
{
gh.throwIfWrongOwner(&pack, pack.artHolder);
if(pack.cmd == ManageBackpackArtifacts::ManageCmd::SORT_BY_CLASS)
result = true;
else if(pack.cmd == ManageBackpackArtifacts::ManageCmd::SORT_BY_COST)
result = true;
else if(pack.cmd == ManageBackpackArtifacts::ManageCmd::SORT_BY_SLOT)
result = true;
}
}
result = gh.manageBackpackArtifacts(pack.player, pack.artHolder, pack.cmd);
}
void ApplyGhNetPackVisitor::visitManageEquippedArtifacts(ManageEquippedArtifacts & pack)