static void new_move(void) { int multkey; int tictime; /* generate a new move command and save it */ multkey = Vid_GetGameKeys(); /* tictime is the game time of the command we are creating */ tictime = latest_player_time[player]; latest_player_commands[player][tictime % MAX_NET_LAG] = multkey; ++latest_player_time[player]; /* Save the current time for lag calculation */ player_command_time[tictime % MAX_NET_LAG] = Timer_GetMS(); /* if this is a multiplayer game, send the command */ if (playmode == PLAYMODE_ASYNCH) { asynput(multkey); } }
swmove() { register OBJECTS *ob, *obn; if ( deltop ) { delbot->ob_next = objfree; objfree = deltop; deltop = delbot = NULL; } if ( ++dispcnt >= keydelay ) dispcnt = 0; ob = objtop; while ( ob ) { obn = ob->ob_next; ob->ob_delflg = ob->ob_drwflg; ob->ob_oldsym = ob->ob_newsym; ob->ob_drwflg = ( *ob->ob_movef )( ob ); if ( ( ( playmode == MULTIPLE ) || ( playmode == ASYNCH ) ) && ( ob->ob_index == multbuff->mu_maxplyr ) && ( !dispcnt ) ) if ( playmode == MULTIPLE ) multput(); else asynput(); ob = obn; } ++countmove; }