/** * Has to be called whenever the momentum of a team has been modified. */ void MomentumChanged() { int playerNum; gentity_t* player; gclient_t* client; team_t team; // send to clients for (playerNum = 0; playerNum < level.maxclients; playerNum++) { player = &g_entities[playerNum]; client = player->client; if (!client) { continue; } team = (team_t) client->pers.team; if (team > TEAM_NONE && team < NUM_TEAMS) { client->ps.persistant[PERS_MOMENTUM] = (short) (level.team[team].momentum * 10.0f + 0.5f); } } // check team progress G_UpdateUnlockables(); }
void BG_InitUnlockackables() { unlockablesDataAvailable = false; unlockablesTeamKnowledge = TEAM_NONE; memset( unlockables, 0, sizeof( unlockables ) ); memset( unlockablesMask, 0, sizeof( unlockablesMask ) ); unlockablesTypeOffset[ UNLT_WEAPON ] = 0; unlockablesTypeOffset[ UNLT_UPGRADE ] = WP_NUM_WEAPONS; unlockablesTypeOffset[ UNLT_BUILDABLE ] = unlockablesTypeOffset[ UNLT_UPGRADE ] + UP_NUM_UPGRADES; unlockablesTypeOffset[ UNLT_CLASS ] = unlockablesTypeOffset[ UNLT_BUILDABLE ] + BA_NUM_BUILDABLES; #ifdef BUILD_SGAME G_UpdateUnlockables(); #endif }