Merge pull request #2012 from Dune-jr/codacy-fixes

Fix a few relevant issues raised by Codacy. #2009
This commit is contained in:
oy 2019-02-03 12:47:00 +01:00 committed by GitHub
commit 040b02c627
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 19 deletions

View file

@ -1044,5 +1044,5 @@
"id": "YT",
"code": 175
}
]},
]}
}

View file

@ -159,7 +159,7 @@
"condition": [
{"x": 0, "y": -1, "value": "empty"},
{"x": 1, "y": 0, "value": "empty"},
{"x": 1, "y": 1, "value": "full"},
{"x": 1, "y": 1, "value": "full"}
]
},
{

View file

@ -517,10 +517,10 @@ void CServerBrowser::RequestImpl(const NETADDR &Addr, CServerEntry *pEntry)
Data.m_pfnCallback = CBFTrackPacket;
Data.m_pCallbackUser = this;
m_pNetClient->Send(&Packet, NET_TOKEN_NONE, &Data);
pEntry->m_TrackID = Data.m_TrackID;
if(pEntry)
{
pEntry->m_TrackID = Data.m_TrackID;
pEntry->m_RequestTime = time_get();
pEntry->m_InfoState = CServerEntry::STATE_PENDING;
}

View file

@ -3517,7 +3517,6 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
static int sEnvelopeEditorID = 0;
static int s_ActiveChannels = 0xf;
if(pEnvelope)
{
CUIRect Button;
@ -3578,23 +3577,20 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
if(UI()->HotItem() == &sEnvelopeEditorID)
{
// do stuff
if(pEnvelope)
if(UI()->MouseButtonClicked(1))
{
if(UI()->MouseButtonClicked(1))
{
// add point
int Time = (int)(((UI()->MouseX()-View.x)*TimeScale)*1000.0f);
float aChannels[4];
pEnvelope->Eval(Time/1000.0f, aChannels);
pEnvelope->AddPoint(Time,
f2fx(aChannels[0]), f2fx(aChannels[1]),
f2fx(aChannels[2]), f2fx(aChannels[3]));
m_Map.m_Modified = true;
}
m_ShowEnvelopePreview = SHOWENV_SELECTED;
m_pTooltip = "Press right mouse button to create a new point";
// add point
int Time = (int)(((UI()->MouseX()-View.x)*TimeScale)*1000.0f);
float aChannels[4];
pEnvelope->Eval(Time/1000.0f, aChannels);
pEnvelope->AddPoint(Time,
f2fx(aChannels[0]), f2fx(aChannels[1]),
f2fx(aChannels[2]), f2fx(aChannels[3]));
m_Map.m_Modified = true;
}
m_ShowEnvelopePreview = SHOWENV_SELECTED;
m_pTooltip = "Press right mouse button to create a new point";
}
vec3 aColors[] = {vec3(1,0.2f,0.2f), vec3(0.2f,1,0.2f), vec3(0.2f,0.2f,1), vec3(1,1,0.2f)};