TownPortalAction.cpp 691 B

1234567891011121314151617181920212223
  1. /*
  2. * TownPortalAction.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "../../Goals/AdventureSpellCast.h"
  12. #include "../../../../lib/mapObjects/MapObjects.h"
  13. #include "TownPortalAction.h"
  14. using namespace AIPathfinding;
  15. Goals::TSubgoal TownPortalAction::whatToDo(const HeroPtr & hero) const
  16. {
  17. const CGTownInstance * targetTown = target; // const pointer is not allowed in settown
  18. return Goals::sptr(Goals::AdventureSpellCast(hero, spellToUse).settown(targetTown).settile(targetTown->visitablePos()));
  19. }