From e040033950a70a9d5cdb40836536720bf6496352 Mon Sep 17 00:00:00 2001 From: OnionKnight Date: Fri, 6 Nov 2009 02:26:25 +0000 Subject: [PATCH] * Fixed bug 38. (Swapping with artifact from backpack) --- client/GUIClasses.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index a9915a396..670454d50 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -3540,7 +3540,11 @@ void CArtPlace::clickLeft(tribool down, bool previousState) } break; default: - LOCPLINT->cb->swapArtifacts(ourOwner->commonInfo->activeArtPlace->ourOwner->curHero, ourOwner->commonInfo->activeArtPlace->slotID, ourOwner->curHero, ourOwner->curHero->artifacts.size()+19); + LOCPLINT->cb->swapArtifacts( + ourOwner->commonInfo->activeArtPlace->ourOwner->curHero, + ourOwner->commonInfo->activeArtPlace->slotID, + ourOwner->curHero, + ourOwner->curHero->artifacts.size() + 19); break; } } @@ -3550,7 +3554,11 @@ void CArtPlace::clickLeft(tribool down, bool previousState) int destSlot = slotID, srcSlot = ourOwner->commonInfo->activeArtPlace->slotID; - LOCPLINT->cb->swapArtifacts(ourOwner->curHero,destSlot,ourOwner->commonInfo->activeArtPlace->ourOwner->curHero,srcSlot); + LOCPLINT->cb->swapArtifacts( + ourOwner->curHero, + destSlot, + ourOwner->commonInfo->activeArtPlace->ourOwner->curHero, + srcSlot); ourOwner->commonInfo->activeArtPlace->clicked = false; ourOwner->commonInfo->activeArtPlace = NULL; @@ -3603,8 +3611,8 @@ void CArtPlace::show(SDL_Surface *to) bool CArtPlace::fitsHere(const CArtifact * art) { if(!art) - return true; //you can have no artifact somewhere - if(slotID > 18 && art->id >= 3 && art->id <= 6 //everything can bee placed in backpack exept of War Machines + return true; // You can place 'no artifact' anywhere. + if(slotID > 18 && !(art->id >= 3 && art->id <= 6) // Anything can be placed in the backpack, except War Machines. || vstd::contains(art->possibleSlots,slotID)) { return true;