Bazaar developer reference

CvCity::getBombardRange(bool &) const

Defined in
CvCity.cpp, line 15956
Class
CvCity
Hook name
CivHooks::CvCity_getBombardRange_with_bool_const
Lua events
GameEvents.GetBombardRange

Hooks

static bool BeforeCvCity_getBombardRange_with_bool_const(const CvCity* self, bool& bIndirectFireAllowed, int& result);static void AfterCvCity_getBombardRange_with_bool_const(const CvCity* self, bool& bIndirectFireAllowed, int& result);static int ReplaceCvCity_getBombardRange_with_bool_const(int (*original)(const CvCity*, bool&), const CvCity* self, bool& bIndirectFireAllowed);CivRegisterBefore<CivHooks::CvCity_getBombardRange_with_bool_const>(host, &BeforeCvCity_getBombardRange_with_bool_const);CivRegisterAfter<CivHooks::CvCity_getBombardRange_with_bool_const>(host, &AfterCvCity_getBombardRange_with_bool_const);CivRegisterReplace<CivHooks::CvCity_getBombardRange_with_bool_const>(host, &ReplaceCvCity_getBombardRange_with_bool_const);

Code

15956int CvCity::getBombardRange(bool& bIndirectFireAllowed) const15957{15958	VALIDATE_OBJECT15959	15960	if (MOD_EVENTS_CITY_BOMBARD) {15961		int iValue = 0;15962		if (GAMEEVENTINVOKE_VALUE(iValue, GAMEEVENT_GetBombardRange, getOwner(), GetID()) == GAMEEVENTRETURN_VALUE) {15963			// Defend against modder stupidity!15964			if (::abs(iValue) <= GC.getMAX_CITY_ATTACK_RANGE()) {15965				bIndirectFireAllowed = (iValue < 0);15966				return ::abs(iValue);15967			}15968		}15969	}15970	15971	bIndirectFireAllowed = GC.getCAN_CITY_USE_INDIRECT_FIRE();15972	return GC.getCITY_ATTACK_RANGE();15973}

Calls

Called by