MCPcopy Create free account
hub / github.com/ddnet/ddnet / CreateDamageInd

Method CreateDamageInd

src/game/server/gamecontext.cpp:276–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276void CGameContext::CreateDamageInd(vec2 Pos, float Angle, int Amount, CClientMask Mask)
277{
278 float a = 3 * pi / 2 + Angle;
279 float s = a - pi / 3;
280 float e = a + pi / 3;
281 for(int i = 0; i < Amount; i++)
282 {
283 float f = mix(s, e, (i + 1) / (float)(Amount + 1));
284 CNetEvent_DamageInd *pEvent = m_Events.Create<CNetEvent_DamageInd>(Mask);
285 if(pEvent)
286 {
287 pEvent->m_X = (int)Pos.x;
288 pEvent->m_Y = (int)Pos.y;
289 pEvent->m_Angle = (int)(f * 256.0f);
290 }
291 }
292}
293
294void CGameContext::CreateHammerHit(vec2 Pos, CClientMask Mask)
295{

Callers 3

TickMethod · 0.80
HandleNinjaMethod · 0.80
DDRaceTickMethod · 0.80

Calls 1

mixFunction · 0.85

Tested by

no test coverage detected