Hooks
static bool BeforeCvGame_selectionListMove(CvGame* self, CvPlot* pPlot, bool bShift);static void AfterCvGame_selectionListMove(CvGame* self, CvPlot* pPlot, bool bShift);static void ReplaceCvGame_selectionListMove(void (*original)(CvGame*, CvPlot*, bool), CvGame* self, CvPlot* pPlot, bool bShift);CivRegisterBefore<CivHooks::CvGame_selectionListMove>(host, &BeforeCvGame_selectionListMove);CivRegisterAfter<CivHooks::CvGame_selectionListMove>(host, &AfterCvGame_selectionListMove);CivRegisterReplace<CivHooks::CvGame_selectionListMove>(host, &ReplaceCvGame_selectionListMove);
Code
2546void CvGame::selectionListMove(CvPlot* pPlot, bool bShift)2547{2548 if(pPlot == NULL)2549 {2550 return;2551 }25522553 auto_ptr<ICvUnit1> pSelectedUnit(GC.GetEngineUserInterface()->GetHeadSelectedUnit());2554 CvUnit* pkSelectedUnit = GC.UnwrapUnitPointer(pSelectedUnit.get());25552556 if((pkSelectedUnit == NULL) || (pkSelectedUnit->getOwner() != getActivePlayer()))2557 {2558 return;2559 }25602561 if(pkSelectedUnit != NULL)2562 {2563 if(pkSelectedUnit->CanSwapWithUnitHere(*pPlot))2564 {2565 selectionListGameNetMessage(GAMEMESSAGE_SWAP_UNITS, CvTypes::getMISSION_SWAP_UNITS(), pPlot->getX(), pPlot->getY(), 0, false, bShift);2566 }2567 else2568 {2569 selectionListGameNetMessage(GAMEMESSAGE_PUSH_MISSION, CvTypes::getMISSION_MOVE_TO(), pPlot->getX(), pPlot->getY(), 0, false, bShift);2570 }2571 }2572}