diff --git a/CCallback.cpp b/CCallback.cpp index ed48978c6..62039c344 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -389,6 +389,9 @@ int CCallback::swapCreatures(const CCreatureSet *s1, const CCreatureSet *s2, int CCreature * pom = S2->slots[p2].first; S2->slots[p2].first = S1->slots[p1].first; S1->slots[p1].first = pom; + int pom2 = S2->slots[p2].second; + S2->slots[p2].second = S1->slots[p1].second; + S1->slots[p1].second = pom2; } } return -1; diff --git a/CCastleInterface.cpp b/CCastleInterface.cpp index 59a300793..c419fc6d8 100644 --- a/CCastleInterface.cpp +++ b/CCastleInterface.cpp @@ -173,7 +173,7 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, bool Activate) } std::sort(buildings.begin(),buildings.end(),srthlp); - garr = new CGarrisonInt(305,387,4,32,townInt,241,13,&town->garrison,(town->garrisonHero)?(&town->garrisonHero->army):(NULL)); + garr = new CGarrisonInt(305,387,4,32,townInt,243,13,&town->garrison,(town->garrisonHero)?(&town->garrisonHero->army):(NULL)); if(Activate) { @@ -197,7 +197,7 @@ CCastleInterface::~CCastleInterface() delete fort; delete bigTownPic; delete flag; - + delete garr; for(int i=0;icreh->bigImgs[creature->idNumber],pos); + char* buf = new char[15]; + itoa(count,buf,10); + blitAt(CGI->creh->bigImgs[creature->idNumber],pos); + printTo(buf,pos.x+56,pos.y+62,GEOR13,zwykly); + if(owner->highlighted==this) + blitAt(CGI->creh->bigImgs[-1],pos); + updateRect(&pos,ekran); + delete [] buf; } else { - SDL_Rect jakis1 = genRect(pos.w,pos.h,owner->offx+ID*(pos.w+owner->interx),owner->offy+upg*(pos.h+owner->intery)), jakis2 = pos; + SDL_Rect jakis1 = genRect(pos.h,pos.w,owner->offx+ID*(pos.w+owner->interx),owner->offy+upg*(pos.h+owner->intery)), jakis2 = pos; SDL_BlitSurface(owner->sur,&jakis1,ekran,&jakis2); SDL_UpdateRect(ekran,pos.x,pos.y,pos.w,pos.h); } @@ -126,10 +133,6 @@ void CGarrisonInt::show() if((*sdown)[i]) (*sdown)[i]->show(); } - if(highlighted) - { - blitAt(CGI->creh->bigImgs[-1],highlighted->pos); - } } void CGarrisonInt::deactiveteSlots() { @@ -236,6 +239,7 @@ void CGarrisonInt::recreateSlots() deactiveteSlots(); deleteSlots(); createSlots(); + ignoreEvent = true; activeteSlots(); show(); } diff --git a/config/buildings2.txt b/config/buildings2.txt index fd0793d32..4e8ccc4ed 100644 --- a/config/buildings2.txt +++ b/config/buildings2.txt @@ -13,6 +13,7 @@ CASTLE 0 22 30 37 +16 END EOD diff --git a/hch/CTownHandler.cpp b/hch/CTownHandler.cpp index 41ee00a47..e46cfe413 100644 --- a/hch/CTownHandler.cpp +++ b/hch/CTownHandler.cpp @@ -118,6 +118,37 @@ void CTownHandler::loadNames() of.close(); of.clear(); + + //of.open("config/buildings4.txt"); + //of >> format; + //while(!of.eof()) + //{ + // std::map >::iterator i; + // std::map::iterator i2; + // int itr=1, buildingID; + // int castleID; + // of >> s; + // if (s != "CASTLE") + // break; + // of >> castleID; + // while(1) + // { + // of >> s; + // if (s == "END") + // break; + // else + // if((i=structures.find(castleID))!=structures.end()) + // if((i2=(i->second.find(buildingID=atoi(s.c_str()))))!=(i->second.end())) + // i2->second->pos.z=itr++; + // else + // std::cout << "Warning1: No building "<