Bazaar developer reference

CvPreGame::setWorldSize(const CvString &)

Defined in
CvPreGame.cpp, line 3092
Hook name
CivHooks::CvPreGame_setWorldSize_with_const_CvString

Hooks

static bool BeforeCvPreGame_setWorldSize_with_const_CvString(const CvString& w);static void AfterCvPreGame_setWorldSize_with_const_CvString(const CvString& w);static void ReplaceCvPreGame_setWorldSize_with_const_CvString(void (*original)(const CvString&), const CvString& w);CivRegisterBefore<CivHooks::CvPreGame_setWorldSize_with_const_CvString>(host, &BeforeCvPreGame_setWorldSize_with_const_CvString);CivRegisterAfter<CivHooks::CvPreGame_setWorldSize_with_const_CvString>(host, &AfterCvPreGame_setWorldSize_with_const_CvString);CivRegisterReplace<CivHooks::CvPreGame_setWorldSize_with_const_CvString>(host, &ReplaceCvPreGame_setWorldSize_with_const_CvString);

Code

3092void setWorldSize(const CvString& w)3093{3094	CvAssert(!gameStarted() || isNetworkMultiplayerGame() || isHotSeatGame());3095	Database::Connection& db = *GC.GetGameDatabase();30963097	Database::Results kQuery;30983099	db.Execute(kQuery, "SELECT * from Worlds where Type = ? LIMIT 1");3100	kQuery.Bind(1, w.c_str(), w.size(), false);31013102	if(kQuery.Step())3103	{3104		s_worldInfo.dirtyGet().CacheResult(kQuery);3105		s_worldSize = (WorldSizeTypes)s_worldInfo.get().GetID();3106		resetSlots();3107	}3108	else3109	{3110		CvAssertMsg(false, "Could not find world size entry.")3111	}3112}

Calls

Called by