Merge branch 'DDRace' of github.com:def-/teeworlds into DDRace

This commit is contained in:
def 2013-10-07 15:36:27 +02:00
commit 6d8e29c8b6
4 changed files with 11 additions and 14 deletions

View file

@ -10,6 +10,7 @@
#include <game/client/gameclient.h>
#include <game/client/animstate.h>
#include <game/client/render.h>
#include <game/client/components/scoreboard.h>
#include "controls.h"
#include "camera.h"
@ -324,7 +325,7 @@ void CHud::RenderTeambalanceWarning()
void CHud::RenderVoting()
{
if(!m_pClient->m_pVoting->IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK)
if((!m_pClient->m_pScoreboard->Active() && m_pClient->m_pVoting->TakenChoice()) || !m_pClient->m_pVoting->IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK)
return;
Graphics()->TextureSet(-1);

View file

@ -535,7 +535,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
MovementSettings.HSplitTop(20.0f, 0, &MovementSettings);
}
UiDoGetButtons(0, 5, MovementSettings);
UiDoGetButtons(0, 6, MovementSettings);
}
@ -549,7 +549,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
TextRender()->Text(0, WeaponSettings.x, WeaponSettings.y, 14.0f*UI()->Scale(), Localize("Weapon"), -1);
WeaponSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &WeaponSettings);
UiDoGetButtons(5, 12, WeaponSettings);
UiDoGetButtons(6, 13, WeaponSettings);
}
// defaults
@ -574,7 +574,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
TextRender()->Text(0, VotingSettings.x, VotingSettings.y, 14.0f*UI()->Scale(), Localize("Voting"), -1);
VotingSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &VotingSettings);
UiDoGetButtons(12, 14, VotingSettings);
UiDoGetButtons(13, 15, VotingSettings);
}
// chat settings
@ -587,7 +587,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
TextRender()->Text(0, ChatSettings.x, ChatSettings.y, 14.0f*UI()->Scale(), Localize("Chat"), -1);
ChatSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &ChatSettings);
UiDoGetButtons(14, 17, ChatSettings);
UiDoGetButtons(15, 18, ChatSettings);
}
// misc settings
@ -599,7 +599,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
TextRender()->Text(0, MiscSettings.x, MiscSettings.y, 14.0f*UI()->Scale(), Localize("Miscellaneous"), -1);
MiscSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &MiscSettings);
UiDoGetButtons(17, 26, MiscSettings);
UiDoGetButtons(18, 27, MiscSettings);
}
}

View file

@ -113,6 +113,7 @@ void CVoting::AddvoteOption(const char *pDescription, const char *pCommand)
void CVoting::Vote(int v)
{
m_Voted = v;
CNetMsg_Cl_Vote Msg = {v};
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
}

View file

@ -151,14 +151,9 @@ bool CGameTeams::SetCharacterTeam(int ClientID, int Team)
if (Team == TEAM_SUPER && !Character(ClientID)->m_Super)
return false;
//if you begin race
if (Character(ClientID)->m_DDRaceState != DDRACE_NONE)
{
//you will be killed if you try to join FLOCK
if (Team == TEAM_FLOCK && m_Core.Team(ClientID) != TEAM_FLOCK)
GetPlayer(ClientID)->KillCharacter(WEAPON_GAME);
else if (Team != TEAM_SUPER)
return false;
}
if (Character(ClientID)->m_DDRaceState != DDRACE_NONE && Team != TEAM_SUPER)
return false;
SetForceCharacterTeam(ClientID, Team);
//GameServer()->CreatePlayerSpawn(Character(id)->m_Core.m_Pos, TeamMask());