I have a problem with my current multiplayer code which I cannot seem to figure out. I have a grenade launcher and I create grenades on the server globally (clients request the creation). The start of the entity function is as follows:
void shoot_grenade()
{
set(my,TRANSLUCENT | PASSABLE);
while(my.client_id < 0)
{
draw_num3d(my.client_id,my.x,0,COLOR_WHITE);
wait(1);
}
reset(my,TRANSLUCENT | PASSABLE);
...
}
Most of the time it works nicely but sometimes (every 1-30th grenade) the entity creation does not seem to get confirmed and client_id stays negative (some value, the same on both client and server). Have you any idea what could cause such behavior?
Why does it get negative on the server anyway, shouldn't that only be happening on a client's computer?
The setup is Server+client (connection == 3), a client, current A8 pro version with session_open/ connect and
dplay_localfunction = 2;
dplay_entrate = 100; // does not make a difference if 1 or 100 for that problem
dplay_smooth = 0;
dplay_maxclients = 16;
dplay_diag = 1;
Btw. I can send in the project if necessary, it's not that huge and only mildly confusing.