diff --git a/AI/VCAI/Goals.cpp b/AI/VCAI/Goals.cpp index 16561de7d..cd479247f 100644 --- a/AI/VCAI/Goals.cpp +++ b/AI/VCAI/Goals.cpp @@ -286,6 +286,12 @@ namespace Goals { return boost::format("Bought army of value %d in town of %s") % value, town->name; } + GetObj::GetObj(int Objid): CGoal(Goals::GET_OBJ) + { + objid = Objid; + tile = ai->myCb->getObjInstance(ObjectInstanceID(objid))->pos; + priority = 3; + } } TSubgoal Trade::whatToDoToAchieve() diff --git a/AI/VCAI/Goals.h b/AI/VCAI/Goals.h index a742323c6..7a97a7f6f 100644 --- a/AI/VCAI/Goals.h +++ b/AI/VCAI/Goals.h @@ -464,15 +464,9 @@ public: class DLL_EXPORT GetObj : public CGoal { public: - GetObj() {} // empty constructor not allowed + GetObj() = delete; // empty constructor not allowed + GetObj(int Objid); - GetObj(int Objid) - : CGoal(Goals::GET_OBJ) - { - objid = Objid; - tile = cb->getObjInstance(ObjectInstanceID(objid))->visitablePos(); - priority = 3; - } TGoalVec getAllPossibleSubgoals() override; TSubgoal whatToDoToAchieve() override; bool operator==(AbstractGoal & g) override;