194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
}
extern int democlientnum;
void
otherplayers()
{
size_t i = 0;
for (id player in players) {
if (player != [OFNull null]) {
const int lagtime = lastmillis - [player lastupdate];
if (lagtime > 1000 && [player state] == CS_ALIVE) {
[player setState:CS_LAGGED];
i++;
continue;
}
if (lagtime && [player state] != CS_DEAD &&
(!demoplayback || i != democlientnum))
// use physics to extrapolate player position
moveplayer(player, 2, false);
}
i++;
}
}
void
respawn()
{
if (player1.state == CS_DEAD) {
player1.attacking = false;
|
|
|
>
|
|
|
|
<
|
|
>
|
|
|
|
|
<
<
|
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
}
extern int democlientnum;
void
otherplayers()
{
[players enumerateObjectsUsingBlock:^(id player, size_t i, bool *stop) {
if (player == [OFNull null])
return;
const int lagtime = lastmillis - [player lastupdate];
if (lagtime > 1000 && [player state] == CS_ALIVE) {
[player setState:CS_LAGGED];
return;
}
if (lagtime && [player state] != CS_DEAD &&
(!demoplayback || i != democlientnum))
// use physics to extrapolate player position
moveplayer(player, 2, false);
}];
}
void
respawn()
{
if (player1.state == CS_DEAD) {
player1.attacking = false;
|