int n = tokenizebyseparator(s, " & ");
string wpn_list = "";
- for (int i = 0; i < n; i++)
+ for (int i = 0; i < n; ++i)
{
Weapon wep = Weapon_from_name(argv(i));
if (wep == WEP_Null)
take_until = strlen(s);
int skip = 0;
- for ( int i = 0; i < take_until; i++ )
+ for ( int i = 0; i < take_until; ++i )
if ( substring(s,i,1) == "\n" )
{
take_until = i;
string cmd;
cmd = "cmd minigame ";
float i;
- for ( i = 0; i < cmdargc; i++ )
+ for ( i = 0; i < cmdargc; ++i )
cmd = strcat(cmd,...(i,string));
localcmd(strcat(cmd,"\n"));
}
{
int letter = offset;
int number = offset;
- for ( int i = 0; i < 3; i++ )
+ for ( int i = 0; i < 3; ++i )
{
number = offset;
- for ( int j = 0; j < 3; j++ )
+ for ( int j = 0; j < 3; ++j )
{
if ( i != 1 || j != 1 )
nmm_spawn_tile(strzone(minigame_tile_buildname(letter,number)),minig, skip+1);
bool nmm_in_mill_string(entity tile, string s)
{
int argc = tokenize(s);
- for ( int i = 0; i < argc; i++ )
+ for ( int i = 0; i < argc; ++i )
{
entity e = nmm_find_tile(tile.owner,argv(i));
if ( !e || !e.nmm_tile_piece || e.nmm_tile_piece.team != tile.nmm_tile_piece.team )
minigame.minigame_flags = NMM_TURN_PLACE|NMM_TURN_TEAM1;
nmm_init_tiles(minigame);
entity e;
- for ( int i = 0; i < 7; i++ )
+ for ( int i = 0; i < 7; ++i )
{
e = msle_spawn(minigame,new(minigame_board_piece));
e.team = 1;
this.SendFlags |= MINIG_SF_UPDATE;
int i;
- for ( i = 1; i <= PONG_MAX_PLAYERS; i++ )
+ for ( i = 1; i <= PONG_MAX_PLAYERS; ++i )
if ( pong_paddle_hit(this, i) )
{
pong_paddle_bounce(this,i);
entity player = ...(0,entity);
int i;
- for ( i = 0; i < PONG_MAX_PLAYERS; i++ )
+ for ( i = 0; i < PONG_MAX_PLAYERS; ++i )
{
if ( minigame.pong_paddles[i] == NULL )
{
entity paddle;
entity ai;
int i;
- for ( i = 0; i < PONG_MAX_PLAYERS; i++ )
+ for ( i = 0; i < PONG_MAX_PLAYERS; ++i )
{
paddle = minigame.pong_paddles[i];
if ( paddle != NULL && paddle.realowner == player )
minigame.SendFlags |= MINIG_SF_UPDATE;
entity ball;
- for ( int j = 0; j < autocvar_sv_minigames_pong_ball_number; j++ )
+ for ( int j = 0; j < autocvar_sv_minigames_pong_ball_number; ++j )
{
ball = msle_spawn(minigame,new(pong_ball));
ball.pong_length = autocvar_sv_minigames_pong_ball_radius;
// potentially compiler bug
int j;
if ( minigame.minigame_flags & PONG_STATUS_WAIT )
- for ( j = 0; j < PONG_MAX_PLAYERS; j++ )
- //for ( int j = 0; j < PONG_MAX_PLAYERS; j++ )
+ for ( j = 0; j < PONG_MAX_PLAYERS; ++j )
+ //for ( int j = 0; j < PONG_MAX_PLAYERS; ++j )
{
if ( minigame.pong_paddles[j] == NULL )
{
if ( minigame.minigame_flags & PONG_STATUS_WAIT )
{
entity paddle;
- for ( int j = PONG_MAX_PLAYERS-1; j >= 0; j-- )
+ for ( int j = PONG_MAX_PLAYERS-1; j >= 0; --j )
{
paddle = minigame.pong_paddles[j];
if ( paddle != NULL &&
}
FOREACH(Nades, true, {
- for (int j = 0; j < 2; j++)
+ for (int j = 0; j < 2; ++j)
{
if (it.m_projectile[j] == proj)
{
void nade_napalm_boom(entity this)
{
- for (int c = 0; c < autocvar_g_nades_napalm_ball_count; c++)
+ for (int c = 0; c < autocvar_g_nades_napalm_ball_count; ++c)
nade_napalm_ball(this);
entity fountain = new(nade_napalm_fountain);
Nade Nade_FromProjectile(int proj)
{
FOREACH(Nades, true, {
- for (int j = 0; j < 2; j++)
+ for (int j = 0; j < 2; ++j)
{
if (it.m_projectile[j] == proj) return it;
}
if(e.material)
{
// since objects are being loaded for the first time, precache material sounds for each
- for (i = 1; i <= 5; i++) // 5 sounds in total
+ for (i = 1; i <= 5; ++i) // 5 sounds in total
precache_sound(strcat("object/impact_", e.material, "_", ftos(i), ".wav"));
}
}
strfree(e.material);
if(argv(3))
{
- for (j = 1; j <= 5; j++) // precache material sounds, 5 in total
+ for (j = 1; j <= 5; ++j) // precache material sounds, 5 in total
precache_sound(strcat("object/impact_", argv(3), "_", ftos(j), ".wav"));
e.material = strzone(argv(3));
}
}
void Local_Notification_Queue_Run(MSG net_type, entity notif)
-{
+{
switch (net_type)
{
case MSG_ANNCE:
}
void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time)
-{
+{
// Guess length if required
if(queue_time == 0)
queue_time = soundlength(AnnouncerFilename(notif.nent_snd));
} else {
// Put in queue
if(notif_queue_length >= NOTIF_QUEUE_MAX) return;
-
+
notif_queue_type[notif_queue_length] = net_type;
notif_queue_entity[notif_queue_length] = notif;
notif_queue_time[notif_queue_length] = notif_queue_next_time;
-
+
notif_queue_next_time += queue_time;
++notif_queue_length;
}
// Shift queue to the left
--notif_queue_length;
- for (int j = 0; j < notif_queue_length; j++) {
+ for (int j = 0; j < notif_queue_length; ++j) {
notif_queue_type[j] = notif_queue_type[j+1];
notif_queue_entity[j] = notif_queue_entity[j+1];
notif_queue_time[j] = notif_queue_time[j+1];
{
vector stuckorigin = this.origin;
vector goodmins = pivot, goodmaxs = pivot;
- for(int bump = 0; bump < 6; bump++)
+ for(int bump = 0; bump < 6; ++bump)
{
int coord = 2 - (bump >> 1);
int dir = (bump & 1);
original_velocity = primal_velocity = this.velocity;
- for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++)
+ for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES; ++bumpcount)
{
if(this.velocity == '0 0 0')
break;
// modify original_velocity so it parallels all of the clip planes
vector new_velocity = '0 0 0';
int plane;
- for (plane = 0;plane < numplanes;plane++)
+ for (plane = 0;plane < numplanes; ++plane)
{
int newplane;
new_velocity = _Movetype_ClipVelocity(original_velocity, planes[plane], 1);
- for (newplane = 0;newplane < numplanes;newplane++)
+ for (newplane = 0;newplane < numplanes; ++newplane)
{
if(newplane != plane)
{
this.angles = this.angles + this.avelocity * dt;
float movetime = dt;
- for (int bump = 0; bump < MAX_CLIP_PLANES && movetime > 0; bump++)
+ for (int bump = 0; bump < MAX_CLIP_PLANES && movetime > 0; ++bump)
{
if(this.velocity == '0 0 0')
break;
if(PS_GR_OUT_DB < 0)
return;
- for (int i = 0; i < 16; i++)
+ for (int i = 0; i < 16; ++i)
if (teamscorekeepers[i])
PlayerStats_GameReport_AddTeam(i + 1);
FOREACH_CLIENT(true, {
n = tokenizebyseparator(s, ", ");
}
string s2 = "";
- for (string arg = ""; i < n; i++)
+ for (string arg = ""; i < n; ++i)
{
if (i >= 0) arg = argv(i);
// cond is the condition for showing the mutator enabled in the menu
// uses electro effects
W_MuzzleFlash(WEP_ELECTRO, actor, weaponentity, w_shotorg, w_shotdir);
- for (int counter = 0; counter < total; counter++)
+ for (int counter = 0; counter < total; ++counter)
{
proj = new(plasma_prim);
proj.owner = proj.realowner = actor;
this.angles += dt * this.avelocity;
float movetime = dt;
- for (int i = 0; i < MAX_CLIP_PLANES && movetime > 0; i++) {
+ for (int i = 0; i < MAX_CLIP_PLANES && movetime > 0; ++i) {
vector push = vel * movetime;
vector p0 = pos;
vector p1 = p0 + push;
int len = bufstr_add(_json_buffer, "0", 0);
if (len) bufstr_set(_json_buffer, len - 1, strcat(bufstr_get(_json_buffer, len - 1), ".length"));
bool required = false;
- for (int n = 0; ; n++) {
+ for (int n = 0; ; ++n) {
string key = ftos(n);
key = _json_ns ? strcat(_json_ns, ".", key) : key;
int it = bufstr_add(_json_buffer, key, 0);
int ofs = cc_len;
if (!check_at_the_end)
ofs--;
- for (; ofs >= 1; ofs--)
+ for (; ofs >= 1; --ofs)
{
if (!(pos >= ofs && text_len >= pos + (cc_len - ofs)))
continue;
{
float i, n;
n = strlen(me.g_maplistCache);
- for (i = 0 ; i < n; i++)
+ for (i = 0 ; i < n; ++i)
{
if (!me.g_maplistCacheQuery(me, i))
me.g_maplistCacheToggle(me, i);
{
float i, n;
n = strlen(me.g_maplistCache);
- for (i = 0 ; i < n; i++)
+ for (i = 0 ; i < n; ++i)
{
if (me.g_maplistCacheQuery(me, i))
me.g_maplistCacheToggle(me, i);
void XonoticWeaponarenaCheckBox_loadCvars(entity me)
{
int n = tokenize_console(cvar_string("menu_weaponarena"));
- for (int i = 0; i < n; i++)
+ for (int i = 0; i < n; ++i)
{
if(argv(i) == me.netname)
{
{
vector org = '0 0 0';
int ctf_flags = 0;
- for (int i = 0; i < 6; i++)
+ for (int i = 0; i < 6; ++i)
{
if (argv(arg_idx + i) != "")
ctf_flags++;
else
{
vector v1, v2, v3, v4, v5, v6;
- for (int i = 1; i <= ctf_flags; i++)
+ for (int i = 1; i <= ctf_flags; ++i)
{
if (i == 1) { v1 = stov(argv(arg_idx++)); org = v1 / ctf_flags; }
else if (i == 2) { v2 = stov(argv(arg_idx++)); org += v2 / ctf_flags; }
void setItemGroupCount()
{
- for (int k = 1; k <= group_count; k++)
+ for (int k = 1; k <= group_count; ++k)
{
int count = 0;
IL_EACH(g_items, IS_SMALL(it.itemdef) && it.item_group == k, { count++; });
entity a = CS(e).accuracy;
if (!a) return;
- for (int i = 0; i < REGISTRY_MAX(Weapons); i++)
+ for (int i = 0; i < REGISTRY_MAX(Weapons); ++i)
{
a.accuracy_frags[i] = 0;
a.accuracy_hit[i] = 0;
float oldtime = time; // do we need to save this?
- for (int iterations = 0; iterations < 128 && !wasfreed(this); iterations++)
+ for (int iterations = 0; iterations < 128 && !wasfreed(this); ++iterations)
{
time = max(oldtime, this.nextthink);
this.nextthink = 0;