From 10a2dfefd1fac30d425fe6aeb0d10f46e0e6b728 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Fri, 6 Jul 2012 14:09:34 +0000 Subject: [PATCH] VCAI will answer CommanderGotLevel query. --- AI/VCAI/VCAI.cpp | 8 ++++++++ AI/VCAI/VCAI.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index f11b4116a..49f583195 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -837,6 +837,14 @@ void VCAI::heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector skills, boost::function &callback) +{ + NET_EVENT_HANDLER; + LOG_ENTRY; + status.addQuery(); + requestActionASAP(boost::bind(callback, 0)); +} + void VCAI::showBlockingDialog(const std::string &text, const std::vector &components, ui32 askID, const int soundID, bool selection, bool cancel) { NET_EVENT_HANDLER; diff --git a/AI/VCAI/VCAI.h b/AI/VCAI/VCAI.h index 9644000a7..3a429a9b4 100644 --- a/AI/VCAI/VCAI.h +++ b/AI/VCAI/VCAI.h @@ -246,7 +246,7 @@ public: virtual void init(CCallback * CB); virtual void yourTurn(); virtual void heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector &skills, boost::function &callback) OVERRIDE; //pskill is gained primary skill, interface has to choose one of given skills and call callback with selection id - virtual void commanderGotLevel (const CCommanderInstance * commander, std::vector skills, boost::function &callback) {}; //TODO + virtual void commanderGotLevel (const CCommanderInstance * commander, std::vector skills, boost::function &callback) OVERRIDE; //TODO virtual void showBlockingDialog(const std::string &text, const std::vector &components, ui32 askID, const int soundID, bool selection, bool cancel) OVERRIDE; //Show a dialog, player must take decision. If selection then he has to choose between one of given components, if cancel he is allowed to not choose. After making choice, CCallback::selectionMade should be called with number of selected component (1 - n) or 0 for cancel (if allowed) and askID. virtual void showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, boost::function &onEnd) OVERRIDE; //all stacks operations between these objects become allowed, interface has to call onEnd when done virtual void serialize(COSer &h, const int version) OVERRIDE; //saving