This commit is contained in:
2026-09-24 15:30:45 -03:00
commit a5af824c91
306 changed files with 58603 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#include "Server.h"
#include <entities/DTBall.h>
bool dtball_tick(Server* server, Entity* entity)
{
DTBall* ball = (DTBall*)entity;
if (ball->side)
{
ball->state += 0.015 * server->delta;
if (ball->state >= 1)
ball->side = 0;
}
else
{
ball->state -= 0.015 * server->delta;
if (ball->state <= -1)
ball->side = 1;
}
Packet pack;
PacketCreate(&pack, SERVER_DTBALL_STATE);
PacketWrite(&pack, packet_writefloat, (float)ball->state);
server_broadcast(server, &pack, false);
return true;
}