diff --git a/CCallback.cpp b/CCallback.cpp index b7b9a7bdd..e4c893bed 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -905,50 +905,6 @@ void CCallback::calculatePaths( const CGHeroInstance *hero, CPathsInfo &out, int gs->calculatePaths(hero, out, src, movement); } -InfoAboutHero::InfoAboutHero() -{ - details = NULL; - hclass = NULL; - portrait = -1; -} - -InfoAboutHero::~InfoAboutHero() -{ - delete details; -} - -void InfoAboutHero::initFromHero( const CGHeroInstance *h, bool detailed ) -{ - owner = h->tempOwner; - hclass = h->type->heroClass; - name = h->name; - portrait = h->portrait; - army = h->army; - - if(detailed) - { - //include details about hero - details = new Details; - details->luck = h->getCurrentLuck(); - details->morale = h->getCurrentMorale(); - details->mana = h->mana; - details->primskills.resize(PRIMARY_SKILLS); - - for (int i = 0; i < PRIMARY_SKILLS ; i++) - { - details->primskills[i] = h->getPrimSkillLevel(i); - } - } - else - { - //hide info about hero stacks counts using descriptives names ids - for(std::map >::iterator i = army.slots.begin(); i != army.slots.end(); ++i) - { - i->second.second = CCreature::getQuantityID(i->second.second); - } - } -} - InfoAboutTown::InfoAboutTown() { tType = NULL; diff --git a/CCallback.h b/CCallback.h index fbc7af4fa..54b193a13 100644 --- a/CCallback.h +++ b/CCallback.h @@ -43,25 +43,6 @@ class CMapHeader; struct CGPathNode; struct CGPath; -struct InfoAboutHero -{ - struct Details - { - std::vector primskills; - int mana, luck, morale; - } *details; - - char owner; - const CHeroClass *hclass; - std::string name; - int portrait; - CCreatureSet army; //numbers of creatures are exact numbers if detailed else they are quantity ids (0 - a few, 1 - several and so on) - - InfoAboutHero(); - ~InfoAboutHero(); - void initFromHero(const CGHeroInstance *h, bool detailed); -}; - struct InfoAboutTown { struct Details diff --git a/client/AdventureMapButton.h b/client/AdventureMapButton.h index fedab4181..a6fe487c8 100644 --- a/client/AdventureMapButton.h +++ b/client/AdventureMapButton.h @@ -22,7 +22,7 @@ class CDefEssential; namespace config{struct ButtonInfo;} -class CButtonBase : public KeyShortcut//basic buttton class +class CButtonBase : public KeyShortcut//basic button class { public: struct TextOverlay diff --git a/client/CHeroWindow.cpp b/client/CHeroWindow.cpp index f574e4145..a876e3188 100644 --- a/client/CHeroWindow.cpp +++ b/client/CHeroWindow.cpp @@ -109,10 +109,10 @@ CHeroWindow::CHeroWindow(int playerColor): expArea->pos = genRect(42, 136, pos.x+83, pos.y + 236); expArea->hoverText = CGI->generaltexth->heroscrn[9]; - morale = new LRClickableAreaWTextComp(); + morale = new MoraleLuckBox(); morale->pos = genRect(45,53,pos.x+240,pos.y+187); - luck = new LRClickableAreaWTextComp(); + luck = new MoraleLuckBox(); luck->pos = genRect(45,53,pos.x+298,pos.y+187); spellPointsArea = new LRClickableAreaWText(); @@ -287,36 +287,8 @@ void CHeroWindow::setHero(const CGHeroInstance *hero) formations->select(hero->army.formation,true); formations->onChange = boost::bind(&CCallback::setFormation, LOCPLINT->cb, hero, _1); - //setting morale - std::vector > mrl = hero->getCurrentMoraleModifiers(); - int mrlv = hero->getCurrentMorale(); - int mrlt = (mrlv>0)-(mrlv<0); //signum: -1 - bad morale, 0 - neutral, 1 - good - morale->hoverText = CGI->generaltexth->heroscrn[4 - mrlt]; - morale->baseType = SComponent::morale; - morale->bonus = mrlv; - morale->text = CGI->generaltexth->arraytxt[88]; - boost::algorithm::replace_first(morale->text,"%s",CGI->generaltexth->arraytxt[86-mrlt]); - if (!mrl.size()) - morale->text += CGI->generaltexth->arraytxt[108]; - else - for(int it=0; it < mrl.size(); it++) - morale->text += "\n" + mrl[it].second; - - - //setting luck - mrl = hero->getCurrentLuckModifiers(); - mrlv = hero->getCurrentLuck(); - mrlt = (mrlv>0)-(mrlv<0); //signum: -1 - bad luck, 0 - neutral, 1 - good - luck->hoverText = CGI->generaltexth->heroscrn[7 - mrlt]; - luck->baseType = SComponent::luck; - luck->bonus = mrlv; - luck->text = CGI->generaltexth->arraytxt[62]; - boost::algorithm::replace_first(luck->text,"%s",CGI->generaltexth->arraytxt[60-mrlt]); - if (!mrl.size()) - luck->text += CGI->generaltexth->arraytxt[77]; - else - for(int it=0; it < mrl.size(); it++) - luck->text += "\n" + mrl[it].second; + morale->set(true, hero); + luck->set(false, hero); //restoring pos pos.x += 65; diff --git a/client/CHeroWindow.h b/client/CHeroWindow.h index 351051922..4e899d260 100644 --- a/client/CHeroWindow.h +++ b/client/CHeroWindow.h @@ -46,9 +46,8 @@ class CHeroWindow: public CWindowWithGarrison std::vector primSkillAreas; LRClickableAreaWText * expArea; LRClickableAreaWText * spellPointsArea; - LRClickableAreaWTextComp * luck; LRClickableAreaWText * specArea;//speciality - LRClickableAreaWTextComp * morale; + MoraleLuckBox * morale, * luck; std::vector secSkillAreas; public: const CGHeroInstance * curHero; diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 05e92fbc2..454096fb1 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -141,6 +141,7 @@ void CPlayerInterface::init(ICallback * CB) } void CPlayerInterface::yourTurn() { + boost::unique_lock un(*pim); LOCPLINT = this; makingTurn = true; diff --git a/client/GUIBase.h b/client/GUIBase.h index c9c5e319c..5b26fd9d3 100644 --- a/client/GUIBase.h +++ b/client/GUIBase.h @@ -306,7 +306,7 @@ public: int ID; //object ID, rarely used by some classes for identification / internal info CIntObject(); - virtual ~CIntObject();; //d-tor + virtual ~CIntObject(); //d-tor //l-clicks handling bool pressedL; //for determining if object is L-pressed @@ -421,6 +421,11 @@ public: SDL_Surface *bg; bool freeSurf; + operator SDL_Surface*() + { + return bg; + } + CPicture(SDL_Surface *BG, int x, int y, bool Free = true); CPicture(const std::string &bmpname, int x, int y); ~CPicture(); diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 983789259..5c06890ea 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -353,7 +353,7 @@ void CGarrisonSlot::show(SDL_Surface * to) char buf[15]; SDL_itoa(count,buf,10); blitAt(imgs[creature->idNumber],pos,to); - printTo(buf, pos.x+pos.w, pos.y+pos.h+1, owner->smallIcons ? FONT_TINY : FONT_VERD, zwykly, to); + printTo(buf, pos.x+pos.w, pos.y+pos.h+1, owner->smallIcons ? FONT_TINY : FONT_MEDIUM, zwykly, to); if((owner->highlighted==this) || (owner->splitting && owner->highlighted->creature == creature)) @@ -1125,8 +1125,8 @@ CStatusBar::CStatusBar(int x, int y, std::string name, int maxw) { bg=BitmapHandler::loadBitmap(name); SDL_SetColorKey(bg,SDL_SRCCOLORKEY,SDL_MapRGB(bg->format,0,255,255)); - pos.x=x; - pos.y=y; + pos.x += x; + pos.y += y; if(maxw >= 0) pos.w = std::min(bg->w,maxw); else @@ -4833,20 +4833,10 @@ void CArtMerchantWindow::Buy() {} void CThievesGuildWindow::activate() { - statusBar->activate(); - exitb->activate(); - resdatabar->activate(); - + CIntObject::activate(); LOCPLINT->statusbar = statusBar; } -void CThievesGuildWindow::deactivate() -{ - statusBar->deactivate(); - exitb->deactivate(); - resdatabar->deactivate(); -} - void CThievesGuildWindow::show(SDL_Surface * to) { blitAt(background, pos.x, pos.y, to); @@ -4870,10 +4860,12 @@ void CThievesGuildWindow::bexitf() CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner) :owner(_owner) { + OBJ_CONSTRUCTION_CAPTURING_ALL; + SThievesGuildInfo tgi; //info to be displayed LOCPLINT->cb->getThievesGuildInfo(tgi, owner); - pos = Rect( (conf.cc.resx - 800) / 2, (conf.cc.resy - 600) / 2, 800, 600 ); + pos = center(Rect(0,0,800,600));// Rect( (conf.cc.resx - 800) / 2, (conf.cc.resy - 600) / 2, 800, 600 ); //loading backround and converting to more bpp form SDL_Surface * bg = background = BitmapHandler::loadBitmap("TpRank.bmp", false); @@ -4881,8 +4873,8 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner) blitAt(bg, 0, 0, background); SDL_FreeSurface(bg); - exitb = new AdventureMapButton (std::string(), std::string(), boost::bind(&CThievesGuildWindow::bexitf,this), 748 + pos.x, 556 + pos.y, "HSBTNS.def", SDLK_RETURN); - statusBar = new CStatusBar(pos.x + 3, pos.y + 555, "TStatBar.bmp", 742); + exitb = new AdventureMapButton (std::string(), std::string(), boost::bind(&CThievesGuildWindow::bexitf,this), 748, 556, "HSBTNS.def", SDLK_RETURN); + statusBar = new CStatusBar(3, 555, "TStatBar.bmp", 742); resdatabar = new CMinorResDataBar(); resdatabar->pos.x += pos.x - 3; @@ -4960,7 +4952,7 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner) //printing best hero int counter = 0; - for(std::map::const_iterator it = tgi.colorToBestHero.begin(); it != tgi.colorToBestHero.end(); ++it) + for(std::map::const_iterator it = tgi.colorToBestHero.begin(); it != tgi.colorToBestHero.end(); ++it) { blitAt(graphics->portraitSmall[it->second.portrait], 260 + 66 * counter, 360, background); counter++; @@ -4979,12 +4971,53 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner) CThievesGuildWindow::~CThievesGuildWindow() { SDL_FreeSurface(background); - delete exitb; - delete statusBar; - delete resdatabar; +// delete exitb; +// delete statusBar; +// delete resdatabar; } + +void MoraleLuckBox::set( bool morale, const CGHeroInstance *hero, int slot /*= -1*/ ) +{ + int mrlv = -9, mrlt = -9; + std::vector > mrl; + + if(morale) + { + //setting morale + mrl = hero->getCurrentMoraleModifiers(); + mrlv = hero->getCurrentMorale(); + mrlt = (mrlv>0)-(mrlv<0); //signum: -1 - bad morale, 0 - neutral, 1 - good + hoverText = CGI->generaltexth->heroscrn[4 - mrlt]; + baseType = SComponent::morale; + bonus = mrlv; + text = CGI->generaltexth->arraytxt[88]; + boost::algorithm::replace_first(text,"%s",CGI->generaltexth->arraytxt[86-mrlt]); + if (!mrl.size()) + text += CGI->generaltexth->arraytxt[108]; + else + for(int it=0; it < mrl.size(); it++) + text += "\n" + mrl[it].second; + } + else + { + //setting luck + mrl = hero->getCurrentLuckModifiers(); + mrlv = hero->getCurrentLuck(); + mrlt = (mrlv>0)-(mrlv<0); //signum: -1 - bad luck, 0 - neutral, 1 - good + hoverText = CGI->generaltexth->heroscrn[7 - mrlt]; + baseType = SComponent::luck; + bonus = mrlv; + text = CGI->generaltexth->arraytxt[62]; + boost::algorithm::replace_first(text,"%s",CGI->generaltexth->arraytxt[60-mrlt]); + if (!mrl.size()) + text += CGI->generaltexth->arraytxt[77]; + else + for(int it=0; it < mrl.size(); it++) + text += "\n" + mrl[it].second; + } +} \ No newline at end of file diff --git a/client/GUIClasses.h b/client/GUIClasses.h index 7e27bd032..2c2b4fccc 100644 --- a/client/GUIClasses.h +++ b/client/GUIClasses.h @@ -408,32 +408,6 @@ public: void sliderMoved(int to); }; -class CCreInfoWindow : public CIntObject -{ -public: - //bool active; //TODO: comment me - int type;//0 - rclick popup; 1 - normal window - SDL_Surface *bitmap; //background - char anf; //animation counter - std::string count; //creature count in text format - - boost::function dsm; //dismiss button callback - CCreaturePic *anim; //related creature's animation - CCreature *c; //related creature - std::vector upgResCost; //cost of upgrade (if not possible then empty) - - AdventureMapButton *dismiss, *upgrade, *ok; - CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function Upg, boost::function Dsm, UpgradeInfo *ui); //c-tor - ~CCreInfoWindow(); //d-tor - void activate(); - void close(); - void clickRight(tribool down, bool previousState); //call-in - void dismissF(); - void keyPressed (const SDL_KeyboardEvent & key); //call-in - void deactivate(); - void show(SDL_Surface * to); -}; - class CLevelWindow : public CIntObject { public: @@ -644,6 +618,13 @@ public: virtual void clickRight(tribool down, bool previousState); }; +class MoraleLuckBox : public LRClickableAreaWTextComp +{ +public: + + void set(bool morale, const CGHeroInstance *hero, int slot = -1); //slot -1 means only hero modifiers +}; + class LRClickableAreaOpenHero: public LRClickableAreaWTextComp { public: @@ -661,6 +642,34 @@ public: void clickRight(tribool down, bool previousState); }; +class CCreInfoWindow : public CIntObject +{ +public: + //bool active; //TODO: comment me + int type;//0 - rclick popup; 1 - normal window + SDL_Surface *bitmap; //background + char anf; //animation counter + std::string count; //creature count in text format + + boost::function dsm; //dismiss button callback + CCreaturePic *anim; //related creature's animation + CCreature *c; //related creature + std::vector upgResCost; //cost of upgrade (if not possible then empty) + + //MoraleLuckBox *luck, *morale; + + AdventureMapButton *dismiss, *upgrade, *ok; + CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function Upg, boost::function Dsm, UpgradeInfo *ui); //c-tor + ~CCreInfoWindow(); //d-tor + void activate(); + void close(); + void clickRight(tribool down, bool previousState); //call-in + void dismissF(); + void keyPressed (const SDL_KeyboardEvent & key); //call-in + void deactivate(); + void show(SDL_Surface * to); +}; + class CArtPlace: public LRClickableAreaWTextComp { private: @@ -855,7 +864,6 @@ class CThievesGuildWindow : public CIntObject public: void activate(); - void deactivate(); void show(SDL_Surface * to); void bexitf(); diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index e42762fae..322f1bb6b 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -628,6 +628,13 @@ void OpenWindow::applyCl(CClient *cl) INTERFACE_CALL_IF_PRESENT(sy->o->tempOwner, showShipyardDialog, sy); } break; + case THIEVES_GUILD: + { + //displays Thieves' Guild window (when hero enters Den of Thieves) + const CGObjectInstance *obj = cl->getObj(id1); + GH.pushInt( new CThievesGuildWindow(obj) ); + } + break; } } @@ -668,10 +675,3 @@ void TradeComponents::applyCl(CClient *cl) tlog2 << "Shop type not supported! \n"; } } - -void SShowThievesGuildWindow::applyCl(CClient *cl) -{ - //displays Thieves' Guild window (when hero enters Den of Thieves) - const CGObjectInstance *obj = cl->getObj(requestingObject); - GH.pushInt( new CThievesGuildWindow(obj) ); -} diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index fbd153487..752a05c36 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -3191,12 +3191,9 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level) if(g->second.color == 255) continue; const CGHeroInstance * best = HLP::findBestHero(this, g->second.color); - SThievesGuildInfo::InfoAboutHero iah; - iah.portrait = best->portrait; - for(int c=0; c= 8); + iah.army.slots.clear(); tgi.colorToBestHero[g->second.color] = iah; } } @@ -3230,18 +3227,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level) } if(level >= 8) //best hero's stats { - for(std::map::const_iterator g = players.begin(); g != players.end(); ++g) - { - if(g->second.color == 255) //do nothing for neutral player - continue; - const CGHeroInstance * best = HLP::findBestHero(this, g->second.color); - - for(int k=0; ksecond.color].primSkills); ++k) - { - //getting prim skills with all bonuses - tgi.colorToBestHero[g->second.color].primSkills[k] = best->getPrimSkillLevel(k); - } - } + //already set in lvl 1 handling } if(level >= 9) //personality { @@ -3619,3 +3605,48 @@ PlayerState::PlayerState() { } + +InfoAboutHero::InfoAboutHero() +{ + details = NULL; + hclass = NULL; + portrait = -1; +} + +InfoAboutHero::~InfoAboutHero() +{ + delete details; +} + +void InfoAboutHero::initFromHero( const CGHeroInstance *h, bool detailed ) +{ + owner = h->tempOwner; + hclass = h->type->heroClass; + name = h->name; + portrait = h->portrait; + army = h->army; + + if(detailed) + { + //include details about hero + details = new Details; + details->luck = h->getCurrentLuck(); + details->morale = h->getCurrentMorale(); + details->mana = h->mana; + details->primskills.resize(PRIMARY_SKILLS); + + for (int i = 0; i < PRIMARY_SKILLS ; i++) + { + details->primskills[i] = h->getPrimSkillLevel(i); + } + } + else + { + //hide info about hero stacks counts using descriptives names ids + for(std::map >::iterator i = army.slots.begin(); i != army.slots.end(); ++i) + { + i->second.second = CCreature::getQuantityID(i->second.second); + } + } +} + diff --git a/lib/CGameState.h b/lib/CGameState.h index 390f68217..9cc954017 100644 --- a/lib/CGameState.h +++ b/lib/CGameState.h @@ -52,39 +52,50 @@ struct MetaString; struct CPack; class CSpell; struct TerrainTile; +class CHeroClass; namespace boost { class shared_mutex; } +struct DLL_EXPORT InfoAboutHero +{ + struct DLL_EXPORT Details + { + std::vector primskills; + int mana, luck, morale; + } *details; + + char owner; + const CHeroClass *hclass; + std::string name; + int portrait; + CCreatureSet army; //numbers of creatures are exact numbers if detailed else they are quantity ids (0 - a few, 1 - several and so on) + + InfoAboutHero(); + ~InfoAboutHero(); + void initFromHero(const CGHeroInstance *h, bool detailed); +}; + + + struct DLL_EXPORT SThievesGuildInfo { std::vector playerColors; //colors of players that are in-game std::vector< std::list< ui8 > > numOfTowns, numOfHeroes, gold, woodOre, mercSulfCrystGems, obelisks, artifacts, army, income; // [place] -> [colours of players] - struct InfoAboutHero - { - ui32 portrait; - si32 primSkills[PRIMARY_SKILLS]; //-1 if not available; otherwise values - - template void serialize(Handler &h, const int version) - { - h & portrait & primSkills; - } - }; - std::map colorToBestHero; //maps player's color to his best heros' std::map personality; // color to personality // -1 - human, AI -> (00 - random, 01 - warrior, 02 - builder, 03 - explorer) std::map bestCreature; // color to ID // id or -1 if not known - template void serialize(Handler &h, const int version) - { - h & playerColors & numOfTowns & numOfHeroes & gold & woodOre & mercSulfCrystGems & obelisks & artifacts & army & income; - h & colorToBestHero & personality & bestCreature; - } +// template void serialize(Handler &h, const int version) +// { +// h & playerColors & numOfTowns & numOfHeroes & gold & woodOre & mercSulfCrystGems & obelisks & artifacts & army & income; +// h & colorToBestHero & personality & bestCreature; +// } }; diff --git a/lib/NetPacks.h b/lib/NetPacks.h index 4c1cd9dc6..23421a2a7 100644 --- a/lib/NetPacks.h +++ b/lib/NetPacks.h @@ -573,7 +573,7 @@ struct OpenWindow : public CPackForClient //517 OpenWindow(){type = 517;}; void applyCl(CClient *cl); - enum EWindow {EXCHANGE_WINDOW, RECRUITMENT_FIRST, RECRUITMENT_ALL, SHIPYARD_WINDOW}; + enum EWindow {EXCHANGE_WINDOW, RECRUITMENT_FIRST, RECRUITMENT_ALL, SHIPYARD_WINDOW, THIEVES_GUILD}; ui8 window; ui32 id1, id2; @@ -1425,19 +1425,6 @@ struct CenterView : public CPackForClient//515 { h & pos & player & focusTime; } -}; - -struct SShowThievesGuildWindow : public CPackForClient //516 -{ - SShowThievesGuildWindow(){CPackForClient::type = 516;}; - void applyCl(CClient *cl); - - si32 requestingObject; - - template void serialize(Handler &h, const int version) - { - h & requestingObject; - } }; diff --git a/lib/RegisterTypes.cpp b/lib/RegisterTypes.cpp index 77b82e35d..696135f0a 100644 --- a/lib/RegisterTypes.cpp +++ b/lib/RegisterTypes.cpp @@ -59,6 +59,7 @@ void registerTypes1(Serializer &s) s.template registerType(); s.template registerType(); s.template registerType(); + s.template registerType(); } template DLL_EXPORT @@ -123,7 +124,6 @@ void registerTypes2(Serializer &s) s.template registerType(); s.template registerType(); s.template registerType(); - s.template registerType(); } template DLL_EXPORT diff --git a/lib/map.cpp b/lib/map.cpp index abc9d9db2..65cfa05b6 100644 --- a/lib/map.cpp +++ b/lib/map.cpp @@ -762,7 +762,7 @@ void Mapa::loadTown( CGObjectInstance * &nobj, const unsigned char * bufor, int nt->identifier = 0; if(version>RoE) { - readNormalNr(bufor,i); i+=4; + nt->identifier = readNormalNr(bufor,i); i+=4; } nt->tempOwner = bufor[i]; ++i; if(readChar(bufor,i)) //has name diff --git a/lib/map.h b/lib/map.h index db6ad3d52..a5a7ef065 100644 --- a/lib/map.h +++ b/lib/map.h @@ -47,7 +47,7 @@ class DLL_EXPORT CCreGenObjInfo : public CSpecObjInfo public: unsigned char player; //owner bool asCastle; - int identifier; + ui32 identifier; unsigned char castles[2]; //allowed castles }; class DLL_EXPORT CCreGen2ObjInfo : public CSpecObjInfo @@ -55,7 +55,7 @@ class DLL_EXPORT CCreGen2ObjInfo : public CSpecObjInfo public: unsigned char player; //owner bool asCastle; - int identifier; + ui32 identifier; unsigned char castles[2]; //allowed castles unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6> }; diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index c36a10236..1de972eb9 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -3460,9 +3460,10 @@ void CGameHandler::showGarrisonDialog( int upobj, int hid, bool removableUnits, void CGameHandler::showThievesGuildWindow(int requestingObjId) { - SShowThievesGuildWindow sthg; - sthg.requestingObject = requestingObjId; - sendAndApply(&sthg); + OpenWindow ow; + ow.window = OpenWindow::THIEVES_GUILD; + ow.id1 = requestingObjId; + sendAndApply(&ow); } bool CGameHandler::isAllowedExchange( int id1, int id2 ) @@ -3638,7 +3639,7 @@ void CGameHandler::checkLossVictory( ui8 player ) setOwner((**i).id,NEUTRAL_PLAYER); } - //eliminating one player may cause victory of anoother: + //eliminating one player may cause victory of another: winLoseHandle(ALL_PLAYERS & ~(1<