Bazaar developer reference

CvPlayer::canPrepare(SpecialistTypes, bool) const

Defined in
CvPlayer.cpp, line 8409
Class
CvPlayer
Hook name
CivHooks::CvPlayer_canPrepare
Lua events
GameEvents.PlayerCanPrepare

Hooks

static bool BeforeCvPlayer_canPrepare(const CvPlayer* self, SpecialistTypes eSpecialist, bool arg1, bool& result);static void AfterCvPlayer_canPrepare(const CvPlayer* self, SpecialistTypes eSpecialist, bool arg1, bool& result);static bool ReplaceCvPlayer_canPrepare(bool (*original)(const CvPlayer*, SpecialistTypes, bool), const CvPlayer* self, SpecialistTypes eSpecialist, bool arg1);CivRegisterBefore<CivHooks::CvPlayer_canPrepare>(host, &BeforeCvPlayer_canPrepare);CivRegisterAfter<CivHooks::CvPlayer_canPrepare>(host, &AfterCvPlayer_canPrepare);CivRegisterReplace<CivHooks::CvPlayer_canPrepare>(host, &ReplaceCvPlayer_canPrepare);

Code

8409bool CvPlayer::canPrepare(SpecialistTypes eSpecialist, bool) const8410{8411	ICvEngineScriptSystem1* pkScriptSystem = gDLL->GetScriptSystem();8412	if(pkScriptSystem)8413	{8414		CvLuaArgsHandle args;8415		args->Push(GetID());8416		args->Push(eSpecialist);84178418		// Attempt to execute the game events.8419		// Will return false if there are no registered listeners.8420		bool bResult = false;8421		if(LuaSupport::CallTestAll(pkScriptSystem, "PlayerCanPrepare", args.get(), bResult))8422		{8423			// Check the result.8424			if(bResult == false)8425			{8426				return false;8427			}8428		}8429	}843084318432	return false;8433}

Calls

Called by