mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
* Minor bug fix for previous fix when transferring artifacts from one hero backpack to another.
This commit is contained in:
parent
64a72c39cb
commit
2b1f395c70
@ -2336,13 +2336,14 @@ bool CGameHandler::swapArtifacts(si32 srcHeroID, si32 destHeroID, ui16 srcSlot,
|
||||
if (destSlot < 19 && (destArtifact || srcSlot < 19))
|
||||
sha.setArtAtPos(srcSlot, destHero->getArtAtPos(destSlot));
|
||||
|
||||
// Correction for destination from removing source artifact in backpack.
|
||||
if (srcSlot >= 19 && destSlot >= 19 && srcSlot < destSlot)
|
||||
destSlot--;
|
||||
|
||||
// Internal hero artifact arrangement.
|
||||
if(srcHero == destHero)
|
||||
if(srcHero == destHero) {
|
||||
// Correction for destination from removing source artifact in backpack.
|
||||
if (srcSlot >= 19 && destSlot >= 19 && srcSlot < destSlot)
|
||||
destSlot--;
|
||||
|
||||
sha.setArtAtPos(destSlot, srcHero->getArtAtPos(srcSlot));
|
||||
}
|
||||
sendAndApply(&sha);
|
||||
if (srcHeroID != destHeroID) {
|
||||
// Exchange between two different heroes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user