Browse Source

GetObj tweak

Dydzio 7 years ago
parent
commit
c0821495e5
2 changed files with 8 additions and 8 deletions
  1. 6 0
      AI/VCAI/Goals.cpp
  2. 2 8
      AI/VCAI/Goals.h

+ 6 - 0
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()

+ 2 - 8
AI/VCAI/Goals.h

@@ -464,15 +464,9 @@ public:
 class DLL_EXPORT GetObj : public CGoal<GetObj>
 {
 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;