Bazaar developer reference

CvPreGame::writeSlotStatus(FDataStream &)

Defined in
CvPreGame.cpp, line 440
Hook name
CivHooks::CvPreGame_writeSlotStatus

Hooks

static bool BeforeCvPreGame_writeSlotStatus(FDataStream& saveTo);static void AfterCvPreGame_writeSlotStatus(FDataStream& saveTo);static void ReplaceCvPreGame_writeSlotStatus(void (*original)(FDataStream&), FDataStream& saveTo);CivRegisterBefore<CivHooks::CvPreGame_writeSlotStatus>(host, &BeforeCvPreGame_writeSlotStatus);CivRegisterAfter<CivHooks::CvPreGame_writeSlotStatus>(host, &AfterCvPreGame_writeSlotStatus);CivRegisterReplace<CivHooks::CvPreGame_writeSlotStatus>(host, &ReplaceCvPreGame_writeSlotStatus);

Code

440void writeSlotStatus(FDataStream& saveTo)441{442	if(s_gameStarted || !isNetworkMultiplayerGame()){443		//full save, preserve everything.444		saveTo << s_slotStatus;445	}446	else{447		//game cfg save only.  Scrub player specific data from our save output.448		//Revert human occupied slots to open.449		std::vector<SlotStatus> slotTemp = s_slotStatus;450		for(std::vector<SlotStatus>::iterator slotIter = slotTemp.begin(); slotIter != slotTemp.end(); ++slotIter){451			if(*slotIter == SS_TAKEN){452				*slotIter = SS_OPEN;453			}454		}455		saveTo << slotTemp;456	}457}

Calls

Called by