CvUnit::setMoves(int)
- Defined in
- CvUnit.cpp, line 16904
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_setMoves
Hooks
static bool BeforeCvUnit_setMoves(CvUnit* self, int iNewValue);static void AfterCvUnit_setMoves(CvUnit* self, int iNewValue);static void ReplaceCvUnit_setMoves(void (*original)(CvUnit*, int), CvUnit* self, int iNewValue);CivRegisterBefore<CivHooks::CvUnit_setMoves>(host, &BeforeCvUnit_setMoves);CivRegisterAfter<CivHooks::CvUnit_setMoves>(host, &AfterCvUnit_setMoves);CivRegisterReplace<CivHooks::CvUnit_setMoves>(host, &ReplaceCvUnit_setMoves);
Code
16904void CvUnit::setMoves(int iNewValue)16905{16906 VALIDATE_OBJECT16907 if(getMoves() != iNewValue)16908 {16909 CvPlot* pPlot = plot();1691016911 m_iMoves = iNewValue;1691216913 auto_ptr<ICvUnit1> pDllUnit(new CvDllUnit(this));16914 gDLL->GameplayUnitShouldDimFlag(pDllUnit.get(), /*bDim*/ getMoves() <= 0);1691516916 if(IsSelected())16917 {16918 GC.getPathFinder().ForceReset();16919 DLLUI->setDirty(UnitInfo_DIRTY_BIT, true);16920 }1692116922 auto_ptr<ICvPlot1> pDllSelectionPlot(DLLUI->getSelectionPlot());16923 int iSelectionPlotIndex = (pDllSelectionPlot.get() != NULL)? pDllSelectionPlot->GetPlotIndex() : -1;1692416925 if(pPlot->GetPlotIndex() == iSelectionPlotIndex)16926 {16927 DLLUI->setDirty(PlotListButtons_DIRTY_BIT, true);16928 }16929 }16930}
Calls
- CvAStar::ForceReset()
- CvDllUnit::CvDllUnit(CvUnit *)
- CvGlobals::getDLLIFace()
- CvGlobals::GetEngineUserInterface()
- CvGlobals::getPathFinder()
- CvPlot::GetPlotIndex() const
- CvUnit::getMoves() const
- CvUnit::IsSelected() const
- CvUnit::plot() const
FAutoVariable::operator=ICvEngineUtility1::GameplayUnitShouldDimFlagICvPlot1::GetPlotIndexICvUserInterface1::getSelectionPlotICvUserInterface1::setDirtystd::auto_ptr::auto_ptrstd::auto_ptr::auto_ptrstd::auto_ptr::getstd::auto_ptr::getstd::auto_ptr::operator->
Called by
- CvCity::Purchase(UnitTypes, BuildingTypes, ProjectTypes, YieldTypes)
- CvCity::initConscriptedUnit()
- CvMilitaryAI::BuyEmergencyUnit(UnitAITypes, CvCity *)
- CvPlayer::DoUnitReset()
- CvGameTrade::MoveUnit(int)
- CvUnit::changeAdmiralPort(int, int)
- CvUnit::changeMoves(int)
- CvUnit::changeTradeUnitHomeCity(int, int)
- CvUnit::convert(CvUnit *, bool)
- CvUnit::finishMoves()
- CvUnit::initWithNameOffset(int, UnitTypes, int, UnitAITypes, PlayerTypes, int, int, DirectionTypes, bool, bool, int, int)
- SetupUnit(const CvWorldBuilderMap::Unit &, int, int)
- CvLuaUnit::lSetMoves(lua_State *)