︙ | | |
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
-
+
-
-
+
+
-
+
-
+
-
+
|
if (m_noitemsrail) {
d->health = 1;
d->ammo[GUN_RIFLE] = 100;
} else {
if (gamemode == 12) {
d->gunselect = GUN_FIST;
return;
}; // eihrul's secret "instafist" mode
} // eihrul's secret "instafist" mode
d->health = 256;
if (m_tarena) {
int gun1 = rnd(4) + 1;
baseammo(d->gunselect = gun1);
for (;;) {
int gun2 = rnd(4) + 1;
if (gun1 != gun2) {
baseammo(gun2);
break;
};
};
}
}
} else if (m_arena) // insta arena
{
d->ammo[GUN_RIFLE] = 100;
} else // efficiency
{
loopi(4) baseammo(i + 1);
d->gunselect = GUN_CG;
};
}
d->ammo[GUN_CG] /= 2;
};
}
} else {
d->ammo[GUN_SG] = 5;
};
}
}
dynent *
newdynent() // create a new blank player or monster
{
dynent *d = (dynent *)malloc(sizeof(dynent));
d->o.x = 0;
|
︙ | | |
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
-
+
|
if (d->state != CS_DEAD) {
alive++;
if (lastteam && strcmp(lastteam, d->team))
oneteam = false;
lastteam = d->team;
} else {
dead++;
};
}
}
int arenarespawnwait = 0;
int arenadetectwait = 0;
void
arenarespawn()
|
︙ | | |
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
-
-
+
+
|
conoutf(
@"team %s is last man standing", lastteam);
else
conoutf(@"everyone died!");
arenarespawnwait = lastmillis + 5000;
arenadetectwait = lastmillis + 10000;
player1->roll = 0;
};
};
}
}
}
void
zapdynent(dynent *&d)
{
if (d)
free(d);
|
︙ | | |
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
-
+
|
{
loopv(players) if (players[i])
{
const int lagtime = lastmillis - players[i]->lastupdate;
if (lagtime > 1000 && players[i]->state == CS_ALIVE) {
players[i]->state = CS_LAGGED;
continue;
};
}
if (lagtime && players[i]->state != CS_DEAD &&
(!demoplayback || i != democlientnum))
moveplayer(
players[i], 2, false); // use physics to extrapolate
// player position
}
}
|
︙ | | |
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
-
+
|
moveplayer(player1, 10, false);
} else if (!m_arena && !m_sp &&
lastmillis - player1->lastaction > 10000)
respawn();
} else if (!intermission) {
moveplayer(player1, 20, true);
checkitems();
};
}
c2sinfo(player1); // do this last, to reduce the
// effective frame lag
}
}
lastmillis = millis;
}
|
︙ | | |
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
-
+
|
d->o.z = ents[spawncycle].z;
d->yaw = ents[spawncycle].attr1;
d->pitch = 0;
d->roll = 0;
} else {
d->o.x = d->o.y = (float)ssize / 2;
d->o.z = 4;
};
}
entinmap(d);
spawnstate(d);
d->state = CS_ALIVE;
}
// movement input code
|
︙ | | |