me.ipAddressBox.cursorPos = 0;
me.ipAddressBoxFocused = -1;
}
-void XonoticServerList_setSortOrder(entity me, float field, float direction)
+void XonoticServerList_setSortOrder(entity me, float fld, float direction)
{
- if(me.currentSortField == field)
+ if(me.currentSortField == fld)
direction = -me.currentSortOrder;
me.currentSortOrder = direction;
- me.currentSortField = field;
- me.sortButton1.forcePressed = (field == SLIST_FIELD_PING);
- me.sortButton2.forcePressed = (field == SLIST_FIELD_NAME);
- me.sortButton3.forcePressed = (field == SLIST_FIELD_MAP);
+ me.currentSortField = fld;
+ me.sortButton1.forcePressed = (fld == SLIST_FIELD_PING);
+ me.sortButton2.forcePressed = (fld == SLIST_FIELD_NAME);
+ me.sortButton3.forcePressed = (fld == SLIST_FIELD_MAP);
me.sortButton4.forcePressed = 0;
- me.sortButton5.forcePressed = (field == SLIST_FIELD_NUMHUMANS);
+ me.sortButton5.forcePressed = (fld == SLIST_FIELD_NUMHUMANS);
me.selectedItem = 0;
if(me.selectedServer)
strunzone(me.selectedServer);
entity e;
e = get_weaponinfo(j);
if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
- self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+ self.(weapon_load[j]) = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
}
oldself = self;
s = strcat(s, " and ", ftos(thisammo), " ", Item_CounterFieldName(j));
// if our weapon is loaded, give its load back to the player
- if(self.weapon_load[self.weapon] > 0)
+ if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammofield += self.weapon_load[self.weapon];
- self.weapon_load[self.weapon] = -1; // schedule the weapon for reloading
+ own.ammofield += self.(weapon_load[self.weapon]);
+ self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
}
}
e = get_weaponinfo(self.switchweapon);
if(e.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) // prevent accessing undefined cvars
{
- self.clip_load = self.weapon_load[self.switchweapon];
+ self.clip_load = self.(weapon_load[self.switchweapon]);
self.clip_size = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
}
else
if(ammo_reload)
{
self.clip_load -= ammo_use;
- self.weapon_load[self.weapon] = self.clip_load;
+ self.(weapon_load[self.weapon]) = self.clip_load;
}
else
self.(self.current_ammo) -= ammo_use;
self.(self.current_ammo) -= 1;
}
}
- self.weapon_load[self.weapon] = self.clip_load;
+ self.(weapon_load[self.weapon]) = self.clip_load;
// do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon,
// then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,
if(self.clip_load < 0)
self.clip_load = 0;
self.old_clip_load = self.clip_load;
- self.clip_load = self.weapon_load[self.weapon] = -1;
+ self.clip_load = self.(weapon_load[self.weapon]) = -1;
}
entity e;
e = get_weaponinfo(nix_weapon);
if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
- self.weapon_load[nix_weapon] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+ self.(weapon_load[nix_weapon]) = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
// nex too
if(autocvar_g_balance_nex_charge)
{
w = get_weaponinfo(i);
- PlayerStats_Event(p, strcat("acc-", w.netname, "-hit"), a.accuracy_hit[i-1]);
- PlayerStats_Event(p, strcat("acc-", w.netname, "-fired"), a.accuracy_fired[i-1]);
+ PlayerStats_Event(p, strcat("acc-", w.netname, "-hit"), a.(accuracy_hit[i-1]));
+ PlayerStats_Event(p, strcat("acc-", w.netname, "-fired"), a.(accuracy_fired[i-1]));
- PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-hit"), a.accuracy_cnt_hit[i-1]);
- PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-fired"), a.accuracy_cnt_fired[i-1]);
+ PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-hit"), a.(accuracy_cnt_hit[i-1]));
+ PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-fired"), a.(accuracy_cnt_fired[i-1]));
- PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.accuracy_frags[i-1]);
+ PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.(accuracy_frags[i-1]));
}
}
longflags = 0;
for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
- if(self.teamscores[i] > 127 || self.teamscores[i] <= -128)
+ if(self.(teamscores[i]) > 127 || self.(teamscores[i]) <= -128)
longflags |= p;
#if MAX_TEAMSCORE <= 8
if(sendflags & p)
{
if(longflags & p)
- WriteInt24_t(MSG_ENTITY, self.teamscores[i]);
+ WriteInt24_t(MSG_ENTITY, self.(teamscores[i]));
else
- WriteChar(MSG_ENTITY, self.teamscores[i]);
+ WriteChar(MSG_ENTITY, self.(teamscores[i]));
}
return TRUE;
longflags = 0;
for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
- if(self.scores[i] > 127 || self.scores[i] <= -128)
+ if(self.(scores[i]) > 127 || self.(scores[i]) <= -128)
longflags |= p;
#if MAX_SCORE <= 8
if(sendflags & p)
{
if(longflags & p)
- WriteInt24_t(MSG_ENTITY, self.scores[i]);
+ WriteInt24_t(MSG_ENTITY, self.(scores[i]));
else
- WriteChar(MSG_ENTITY, self.scores[i]);
+ WriteChar(MSG_ENTITY, self.(scores[i]));
}
return TRUE;
entity axh;
axh_id = bound(0, axh_id, MAX_AXH);
- axh = own.AuxiliaryXhair[axh_id];
+ axh = own.(AuxiliaryXhair[axh_id]);
if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
setorigin(axh, loc);
axh.colormod = clr;
axh.SendFlags = 0x01;
- own.AuxiliaryXhair[axh_id] = axh;
+ own.(AuxiliaryXhair[axh_id]) = axh;
}
/*
return TRUE;
ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
- ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
return TRUE;
ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RELOAD)
{
dt = min(dt, owner_player.clip_load / autocvar_g_balance_electro_primary_ammo);
owner_player.clip_load = max(0, owner_player.clip_load - autocvar_g_balance_electro_primary_ammo * frametime);
- owner_player.weapon_load[WEP_ELECTRO] = owner_player.clip_load;
+ owner_player.(weapon_load[WEP_ELECTRO]) = owner_player.clip_load;
}
else
{
ammo_amount = 1;
else
ammo_amount = self.ammo_cells > 0;
- ammo_amount += self.weapon_load[WEP_ELECTRO] > 0;
+ ammo_amount += self.(weapon_load[WEP_ELECTRO]) > 0;
}
else
{
ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_primary_ammo;
- ammo_amount += self.weapon_load[WEP_ELECTRO] >= autocvar_g_balance_electro_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_primary_ammo;
}
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_ELECTRO] >= autocvar_g_balance_electro_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RESETPLAYER)
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
- ammo_amount += self.weapon_load[WEP_FIREBALL] >= autocvar_g_balance_fireball_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_FIREBALL]) >= autocvar_g_balance_fireball_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_FIREBALL] >= autocvar_g_balance_fireball_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_FIREBALL]) >= autocvar_g_balance_fireball_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RESETPLAYER)
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_grenadelauncher_primary_ammo;
- ammo_amount += self.weapon_load[WEP_GRENADE_LAUNCHER] >= autocvar_g_balance_grenadelauncher_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_GRENADE_LAUNCHER]) >= autocvar_g_balance_grenadelauncher_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_grenadelauncher_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_GRENADE_LAUNCHER] >= autocvar_g_balance_grenadelauncher_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_GRENADE_LAUNCHER]) >= autocvar_g_balance_grenadelauncher_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RELOAD)
// this is different than WR_CHECKAMMO when it comes to reloading
if(autocvar_g_balance_hagar_reload_ammo)
- enough_ammo = self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
+ enough_ammo = self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_secondary_ammo;
else
enough_ammo = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
- ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RESETPLAYER)
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
- ammo_amount += self.weapon_load[WEP_HLAC] >= autocvar_g_balance_hlac_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_HLAC]) >= autocvar_g_balance_hlac_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_HLAC] >= autocvar_g_balance_hlac_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_HLAC]) >= autocvar_g_balance_hlac_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RELOAD)
if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_minelayer_ammo;
- ammo_amount += self.weapon_load[WEP_MINE_LAYER] >= autocvar_g_balance_minelayer_ammo;
+ ammo_amount += self.(weapon_load[WEP_MINE_LAYER]) >= autocvar_g_balance_minelayer_ammo;
return ammo_amount;
}
}
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_cells >= minstanex_ammo;
- ammo_amount += self.weapon_load[WEP_MINSTANEX] >= minstanex_ammo;
+ ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= minstanex_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
if(!autocvar_g_balance_minstanex_laser_ammo)
return TRUE;
ammo_amount = self.ammo_cells >= autocvar_g_balance_minstanex_laser_ammo;
- ammo_amount += self.weapon_load[WEP_MINSTANEX] >= autocvar_g_balance_minstanex_laser_ammo;
+ ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= autocvar_g_balance_minstanex_laser_ammo;
return ammo_amount;
}
else if (req == WR_RESETPLAYER)
{
self.clip_load = max(autocvar_g_balance_nex_secondary_ammo, self.clip_load - autocvar_g_balance_nex_secondary_ammo * dt);
}
- self.weapon_load[WEP_NEX] = self.clip_load;
+ self.(weapon_load[WEP_NEX]) = self.clip_load;
}
else
{
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_primary_ammo;
- ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_primary_ammo);
+ ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_primary_ammo);
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
// don't allow charging if we don't have enough ammo
ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RELOAD)
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_nails >= autocvar_g_balance_rifle_primary_ammo;
- ammo_amount += self.weapon_load[WEP_RIFLE] >= autocvar_g_balance_rifle_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_RIFLE]) >= autocvar_g_balance_rifle_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_nails >= autocvar_g_balance_rifle_secondary_ammo;
- ammo_amount += self.weapon_load[WEP_RIFLE] >= autocvar_g_balance_rifle_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_RIFLE]) >= autocvar_g_balance_rifle_secondary_ammo;
return ammo_amount;
}
else if (req == WR_RESETPLAYER)
{
if(autocvar_g_balance_rocketlauncher_reload_ammo)
{
- if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.weapon_load[WEP_ROCKET_LAUNCHER] < autocvar_g_balance_rocketlauncher_ammo)
+ if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.(weapon_load[WEP_ROCKET_LAUNCHER]) < autocvar_g_balance_rocketlauncher_ammo)
ammo_amount = TRUE;
}
else if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_missile_ammo;
- ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_missile_ammo;
+ ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_missile_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo;
- ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_tag_ammo;
+ ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo;
return ammo_amount;
}
else if (req == WR_RELOAD)
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
- ammo_amount += self.weapon_load[WEP_SHOTGUN] >= autocvar_g_balance_shotgun_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_SHOTGUN]) >= autocvar_g_balance_shotgun_primary_ammo;
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
if(autocvar_g_balance_uzi_reload_ammo)
{
if(autocvar_g_balance_uzi_mode == 1)
- ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_sustained_ammo;
+ ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_sustained_ammo;
else
- ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_first_ammo;
+ ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_first_ammo;
}
return ammo_amount;
}
if(autocvar_g_balance_uzi_reload_ammo)
{
if(autocvar_g_balance_uzi_mode == 1)
- ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_burst_ammo;
+ ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_burst_ammo;
else
- ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_first_ammo;
+ ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_first_ammo;
}
return ammo_amount;
}