CvUnit::airStrikeTarget(CvPlot &, bool) const
- Defined in
- CvUnit.cpp, line 24172
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_airStrikeTarget
Hooks
static bool BeforeCvUnit_airStrikeTarget(const CvUnit* self, CvPlot& targetPlot, bool bNoncombatAllowed, CvUnit*& result);static void AfterCvUnit_airStrikeTarget(const CvUnit* self, CvPlot& targetPlot, bool bNoncombatAllowed, CvUnit*& result);static CvUnit* ReplaceCvUnit_airStrikeTarget(CvUnit* (*original)(const CvUnit*, CvPlot&, bool), const CvUnit* self, CvPlot& targetPlot, bool bNoncombatAllowed);CivRegisterBefore<CivHooks::CvUnit_airStrikeTarget>(host, &BeforeCvUnit_airStrikeTarget);CivRegisterAfter<CivHooks::CvUnit_airStrikeTarget>(host, &AfterCvUnit_airStrikeTarget);CivRegisterReplace<CivHooks::CvUnit_airStrikeTarget>(host, &ReplaceCvUnit_airStrikeTarget);
Code
24172CvUnit* CvUnit::airStrikeTarget(CvPlot& targetPlot, bool bNoncombatAllowed) const24173{24174 VALIDATE_OBJECT24175 UnitHandle pDefender;2417624177 pDefender = targetPlot.getBestDefender(NO_PLAYER, getOwner(), this, true, false, false, bNoncombatAllowed); // All defaults, except test for war, and allow noncombat units2417824179 if(pDefender)24180 {24181 if(!pDefender->IsDead())24182 {24183 return pDefender.pointer();24184 }24185 }2418624187 return NULL;24188}
Calls
- CvPlot::getBestDefender(PlayerTypes, PlayerTypes, const CvUnit *, bool, bool, bool, bool)
- CvUnit::getOwner() const
- CvUnit::IsDead() const
FObjectHandle::FObjectHandleFObjectHandle::operator boolFObjectHandle::operator->FObjectHandle::operator=FObjectHandle::pointer