mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Merge pull request #2012 from Dune-jr/codacy-fixes
Fix a few relevant issues raised by Codacy. #2009
This commit is contained in:
commit
040b02c627
|
@ -1044,5 +1044,5 @@
|
|||
"id": "YT",
|
||||
"code": 175
|
||||
}
|
||||
]},
|
||||
]}
|
||||
}
|
||||
|
|
|
@ -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"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)};
|
||||
|
|
Loading…
Reference in a new issue