X-Git-Url: https://deadsoftware.ru/gitweb?p=netwar.git;a=blobdiff_plain;f=client.c;h=c1c9a557c7368229b647ebea1467f47c2d6c0207;hp=defe5ec757891aad33ee0c4d92dc8d3338163b1d;hb=4148d3ff0c0c4b52b0741c38a867a1502600a65f;hpb=c4b04d12861ae0eac6315b1c2170013422136f80 diff --git a/client.c b/client.c index defe5ec..c1c9a55 100644 --- a/client.c +++ b/client.c @@ -38,6 +38,19 @@ static void cl_update_svplayer(ProtocolMessage m) { ); } +static void cl_update_svbullet(ProtocolMessage m) { + g_bullet_set( + m.sv.sbul.id, + m.sv.sbul.owner, + m.sv.sbul.live, + b2f(m.sv.sbul.x), + b2f(m.sv.sbul.y), + b2f(m.sv.sbul.vx), + b2f(m.sv.sbul.vy), + m.sv.sbul.tick + ); +} + void cl_connect(const char * host, uint16_t port) { if(SDLNet_ResolveHost(&addr, host, (port) ? (port) : (DEFAULT_PORT)) != 0) { SDL_Log("Unable to resolve host: %s\n", SDLNet_GetError()); @@ -80,6 +93,7 @@ void cl_recv() { case SV_INFO: cl_update_svinfo(m); break; case SV_KILL: cl_kill_client(m); break; case SV_SPLR: cl_update_svplayer(m); break; + case SV_SBUL: cl_update_svbullet(m); break; default: SDL_Log("invalid message %i", m.type); } }