MCPcopy Create free account
hub / github.com/bwapi/bwapi / _InitializePlayerConsole

Function _InitializePlayerConsole

bwapi/BWAPI/Source/Detours.cpp:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void _InitializePlayerConsole() // after
87{
88 for (int i = 0; i < BW::PLAYABLE_PLAYER_COUNT; ++i)
89 {
90 // Retrieve the original race value before randomization occurred from the mapped index
91 int mapID = getMappedIndex(BW::BWDATA::Players[i].dwStormId);
92 BWAPI::BroodwarImpl.lastKnownRaceBeforeStart[i] = (mapID == -1) ? BWAPI::Races::None : BWAPI::Race( savedRace[mapID] );
93
94 // Reset the computer player's storm ID
95 if ( BW::BWDATA::Players[i].dwStormId < 0 )
96 BW::BWDATA::Players[i].dwStormId = -1;
97 }
98
99 // Call original fxn
100 BW::BWFXN_InitializePlayerConsole();
101}
102
103//------------------------------------------------ TRIGGERS --------------------------------------------------
104void __stdcall ExecuteGameTriggers(DWORD dwMillisecondsPerFrame)

Callers

nothing calls this directly

Calls 2

getMappedIndexFunction · 0.85
RaceClass · 0.50

Tested by

no test coverage detected