false
);
- float lag = ANTILAG_LATENCY(actor);
+ float lag = ((IS_REAL_CLIENT(actor)) ? ANTILAG_LATENCY(actor) : 0);
if(lag < 0.001)
lag = 0;
- if (!IS_REAL_CLIENT(actor))
- lag = 0;
if(autocvar_g_antilag == 0 || actor.cvar_cl_noantilag)
lag = 0; // only do hitscan, but no antilag
if(lag)
+ (v_up * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_up))
+ (v_right * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_side)));
- WarpZone_traceline_antilag(this, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ANTILAG_LATENCY(this.realowner));
+ WarpZone_traceline_antilag(this, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ((IS_CLIENT(this.realowner)) ? ANTILAG_LATENCY(this.realowner) : 0));
// draw lightning beams for debugging
//te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
#ifndef WARPZONE_DONT_FIX_VANGLE
if(IS_REAL_CLIENT(this))
if(this.v_angle.z <= 360) // if not already adjusted
- if(time - this.ping * 0.001 < this.warpzone_teleport_time)
+ if(time - CS(this).ping * 0.001 < this.warpzone_teleport_time)
{
this.v_angle = WarpZone_TransformVAngles(this.warpzone_teleport_zone, this.v_angle);
this.v_angle_z += 720; // mark as adjusted
.float antilag_debug;
-#define ANTILAG_LATENCY(e) min(0.4, e.ping * 0.001)
+#define ANTILAG_LATENCY(e) min(0.4, CS(e).ping * 0.001)
// add one ticrate?
return;
}
this.bot_aimtarg = e1;
- this.bot_aimlatency = this.ping; // FIXME? Shouldn't this be in the lag item?
+ this.bot_aimlatency = CS(this).ping; // FIXME? Shouldn't this be in the lag item?
//this.bot_aimorigin = v1;
//this.bot_aimvelocity = v2;
this.bot_aimtargorigin = v3;
// (simulated network latency + naturally delayed reflexes)
//this.ping = 0.7 - bound(0, 0.05 * skill, 0.5); // moved the reflexes to bot_aimdir (under the name 'think')
// minimum ping 20+10 random
- this.ping = bound(0,0.07 - bound(0, (skill + this.bot_pingskill) * 0.005,0.05)+random()*0.01,0.65); // Now holds real lag to server, and higer skill players take a less laggy server
+ CS(this).ping = bound(0,0.07 - bound(0, (skill + this.bot_pingskill) * 0.005,0.05)+random()*0.01,0.65); // Now holds real lag to server, and higer skill players take a less laggy server
// skill 10 = ping 0.2 (adrenaline)
// skill 0 = ping 0.7 (slightly drunk)
vector enemyvel = this.enemy.velocity;
if (!this.enemy.waterlevel)
enemyvel.z = 0;
- lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
+ lag_additem(this, time + CS(this).ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
}
else
- lag_additem(this, time + this.ping, 0, 0, NULL, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
+ lag_additem(this, time + CS(this).ping, 0, 0, NULL, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
}
bool havocbot_moveto_refresh_route(entity this)
store.cursor_trace_endpos = this.cursor_trace_endpos;
store.cursor_trace_ent = this.cursor_trace_ent;
- // TODO: ping?
+ store.ping = this.ping;
+ store.ping_packetloss = this.ping_packetloss;
+ store.ping_movementloss = this.ping_movementloss;
store.v_angle = this.v_angle;
store.movement = this.movement;
ATTRIB(Client, cursor_trace_endpos, vector, this.cursor_trace_endpos);
ATTRIB(Client, cursor_trace_ent, entity, this.cursor_trace_ent);
+ ATTRIB(Client, ping, float, this.ping);
+ ATTRIB(Client, ping_packetloss, float, this.ping_packetloss);
+ ATTRIB(Client, ping_movementloss, float, this.ping_movementloss);
+
ATTRIB(Client, v_angle, vector, this.v_angle);
ATTRIB(Client, movement, vector, this.movement);
print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "),
etof(it),
it.netname,
- it.ping,
- it.ping_packetloss,
+ CS(it).ping,
+ CS(it).ping_packetloss,
process_time(1, time - it.jointime),
tmp_netaddress,
tmp_crypto_idfp));
{
if(deathtype == DEATH_FIRE.m_id)
{
- Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : targ.ping));
- Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping));
+ Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping));
+ Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping));
return true;
}
CHOICE_TYPEFRAG,
targ.netname,
kill_count_to_attacker,
- (IS_BOT_CLIENT(targ) ? -1 : targ.ping)
+ (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping)
);
Send_Notification(
NOTIF_ONE,
kill_count_to_target,
attacker.health,
attacker.armorvalue,
- (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)
+ (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping)
);
}
else if(!frag_centermessage_override(attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target))
CHOICE_FRAG,
targ.netname,
kill_count_to_attacker,
- (IS_BOT_CLIENT(targ) ? -1 : targ.ping)
+ (IS_BOT_CLIENT(targ) ? -1 : CS(targ).ping)
);
Send_Notification(
NOTIF_ONE,
kill_count_to_target,
attacker.health,
attacker.armorvalue,
- (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)
+ (IS_BOT_CLIENT(attacker) ? -1 : CS(attacker).ping)
);
}
{
WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
WriteByte(MSG_BROADCAST, this.cnt);
- WriteShort(MSG_BROADCAST, bound(1, e.ping, 65535));
- WriteByte(MSG_BROADCAST, min(ceil(e.ping_packetloss * 255), 255));
- WriteByte(MSG_BROADCAST, min(ceil(e.ping_movementloss * 255), 255));
+ WriteShort(MSG_BROADCAST, bound(1, CS(e).ping, 65535));
+ WriteByte(MSG_BROADCAST, min(ceil(CS(e).ping_packetloss * 255), 255));
+ WriteByte(MSG_BROADCAST, min(ceil(CS(e).ping_movementloss * 255), 255));
// record latency times for clients throughout the match so we can report it to playerstats
if(time > (e.latency_time + LATENCY_THINKRATE))
{
- e.latency_sum += e.ping;
+ e.latency_sum += CS(e).ping;
e.latency_cnt += 1;
e.latency_time = time;
//print("sum: ", ftos(e.latency_sum), ", cnt: ", ftos(e.latency_cnt), ", avg: ", ftos(e.latency_sum / e.latency_cnt), ".\n");
if(STAT(FROZEN, frag_target))
return; // target was already frozen, so this is just pushing them off the cliff
- Send_Notification(NOTIF_ONE, frag_attacker, MSG_CHOICE, CHOICE_FRAG_FREEZE, frag_target.netname, kill_count_to_attacker, (IS_BOT_CLIENT(frag_target) ? -1 : frag_target.ping));
- Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target, frag_attacker.health, frag_attacker.armorvalue, (IS_BOT_CLIENT(frag_attacker) ? -1 : frag_attacker.ping));
+ Send_Notification(NOTIF_ONE, frag_attacker, MSG_CHOICE, CHOICE_FRAG_FREEZE, frag_target.netname, kill_count_to_attacker, (IS_BOT_CLIENT(frag_target) ? -1 : CS(frag_target).ping));
+ Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target, frag_attacker.health, frag_attacker.armorvalue, (IS_BOT_CLIENT(frag_attacker) ? -1 : CS(frag_attacker).ping));
return true;
}
else
fireBullet_trace_callback_eff = EFFECT_BULLET;
- float lag = ANTILAG_LATENCY(this);
+ float lag = ((IS_REAL_CLIENT(this)) ? ANTILAG_LATENCY(this) : 0);
if(lag < 0.001)
lag = 0;
- if (!IS_REAL_CLIENT(this))
- lag = 0;
if(autocvar_g_antilag == 0 || this.cvar_cl_noantilag)
lag = 0; // only do hitscan, but no antilag
if(lag)