Hooks
static bool BeforeCvGame_DoMinorBullyUnit(CvGame* self, PlayerTypes eBully, PlayerTypes eMinor);static void AfterCvGame_DoMinorBullyUnit(CvGame* self, PlayerTypes eBully, PlayerTypes eMinor);static void ReplaceCvGame_DoMinorBullyUnit(void (*original)(CvGame*, PlayerTypes, PlayerTypes), CvGame* self, PlayerTypes eBully, PlayerTypes eMinor);CivRegisterBefore<CivHooks::CvGame_DoMinorBullyUnit>(host, &BeforeCvGame_DoMinorBullyUnit);CivRegisterAfter<CivHooks::CvGame_DoMinorBullyUnit>(host, &AfterCvGame_DoMinorBullyUnit);CivRegisterReplace<CivHooks::CvGame_DoMinorBullyUnit>(host, &ReplaceCvGame_DoMinorBullyUnit);
Code
10562/// Do the action of a major bullying a unit from a minor10563void CvGame::DoMinorBullyUnit(PlayerTypes eBully, PlayerTypes eMinor)10564{10565 CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)");10566 CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)");10567 CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)");10568 CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)");1056910570#if defined(MOD_BUGFIX_UNITCLASS_NOT_UNIT)10571 UnitTypes eUnitType = GET_PLAYER(eBully).GetSpecificUnitType("UNITCLASS_WORKER");10572#else10573 UnitTypes eUnitType = (UnitTypes) GC.getInfoTypeForString("UNIT_WORKER"); //antonjs: todo: XML/function10574#endif1057510576 gDLL->sendMinorBullyUnit(eBully, eMinor, eUnitType);10577}