Bazaar developer reference

isSpyNameInUse(const char *)

Defined in
CvEspionageClasses.cpp, line 1171
Hook name
CivHooks::isSpyNameInUse_with_const_char

Hooks

static bool BeforeisSpyNameInUse_with_const_char(const char* szSpyName, bool& result);static void AfterisSpyNameInUse_with_const_char(const char* szSpyName, bool& result);static bool ReplaceisSpyNameInUse_with_const_char(bool (*original)(const char*), const char* szSpyName);CivRegisterBefore<CivHooks::isSpyNameInUse_with_const_char>(host, &BeforeisSpyNameInUse_with_const_char);CivRegisterAfter<CivHooks::isSpyNameInUse_with_const_char>(host, &AfterisSpyNameInUse_with_const_char);CivRegisterReplace<CivHooks::isSpyNameInUse_with_const_char>(host, &ReplaceisSpyNameInUse_with_const_char);

Code

1171bool isSpyNameInUse(const char* szSpyName)1172{1173	for (int iPlayer = 0; iPlayer < MAX_MAJOR_CIVS; iPlayer++) {1174		CvPlayerAI& thisPlayer = GET_PLAYER((PlayerTypes)iPlayer);1175		if (thisPlayer.isEverAlive()) {1176			if (isSpyNameInUse(&thisPlayer, szSpyName)) {1177				return true;1178			}1179		}1180	}1181	1182	return false;1183}

Calls

Called by