本文整理汇总了C++中CVarTrack::SetFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ CVarTrack::SetFloat方法的具体用法?C++ CVarTrack::SetFloat怎么用?C++ CVarTrack::SetFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVarTrack
的用法示例。
在下文中一共展示了CVarTrack::SetFloat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetServerSettings
void CServerMissionMgr::SetServerSettings(ServerMissionSettings& ServerSettings)
{
if (!g_vtNetFriendlyFire.IsInitted())
{
g_vtNetFriendlyFire.Init(g_pLTServer, "NetFriendlyFire", LTNULL, 1.0f);
}
if (!g_vtDifficultyFactorPlayerIncrease.IsInitted())
{
g_vtDifficultyFactorPlayerIncrease.Init( g_pLTServer, "DifficultyFactorPlayerIncrease", LTNULL, 0.1f );
}
if( !g_vtRunSpeed.IsInitted( ))
{
g_vtRunSpeed.Init( g_pLTServer, "RunSpeed", NULL, 1.0f );
}
m_ServerSettings = ServerSettings;
g_vtNetFriendlyFire.SetFloat( ( ServerSettings.m_bFriendlyFire ? 1.0f : 0.0f) );
if (IsDifficultyGameType())
{
g_pGameServerShell->SetDifficulty((GameDifficulty)ServerSettings.m_nMPDifficulty);
g_pLTServer->CPrint("CServerMissionMgr::StartGame() setting difficulty to %d",ServerSettings.m_nMPDifficulty);
}
else
g_pGameServerShell->SetDifficulty(GD_NORMAL);
g_vtDifficultyFactorPlayerIncrease.SetFloat(ServerSettings.m_fPlayerDiffFactor);
// Only adjust the runspeed if this is a gametype that allows it.
if( !IsCoopMultiplayerGameType( ))
g_vtRunSpeed.SetFloat( (float)ServerSettings.m_nRunSpeed / 100.0f );
}