Skip to content

Commit

Permalink
Merge pull request #1289 from newbytf/dev-cur
Browse files Browse the repository at this point in the history
Dev cur
  • Loading branch information
newbytf authored Jan 22, 2024
2 parents 8419a42 + 5234f48 commit 949dfde
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 36 deletions.
4 changes: 0 additions & 4 deletions ssqc/client.qc
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,6 @@ void () DecodeLevelParms = {
asscanrange = CF_GetSetting("acr", "asscanrange", "0");
asscanrangedie = CF_GetSetting("acrd", "asscanrangedie", "0");

// remote_client_time max delta
antilag_settings.rewind_detpipe =
CF_GetSetting("alrd", "al_rewind_detpipe", "on");

// CSQC projectiles
fo_projectiles = CF_GetSetting("focp", "fo_csqc_projectiles", "on");

Expand Down
45 changes: 21 additions & 24 deletions ssqc/engineer.qc
Original file line number Diff line number Diff line change
Expand Up @@ -158,60 +158,57 @@ static void draw_beam(vector a, vector b, int effect) {
}

void W_FireImpeller() {
if (!cb_prematch) {
self.special_next = time + 3;
}

FO_Sound(self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
makevectors(self.v_angle);

float rewound = RewindPlayersExceptSelf(0);

if (!cb_prematch)
self.special_next = time + 3;

vector org = self.origin + '0 0 16';
float direct = FALSE, jump = FALSE;
entity t = FindImpellerTarget(org, 0.985, &direct);
vector end = t.origin;
float direct = FALSE;
entity hit = FindImpellerTarget(org, 0.985, &direct);

if (rewound)
FOPlayer::RestoreAll();

float mag = 250;
entity hit;
vector end;

if (t == world) {
if (hit == world) {
traceline(org, org + 350 * v_forward, MOVE_WORLDONLY, world);
if (trace_fraction == 1)
return;

end = trace_endpos;
hit = self;
draw_beam(org, trace_endpos, TE_LIGHTNING2);
draw_beam(org, end, TE_LIGHTNING2);
} else {
hit = t;

if (direct) {
end = t.origin;
draw_beam(org, t.origin, TE_LIGHTNING2);
end = hit.origin;
draw_beam(org, end, TE_LIGHTNING2);
} else {
vector a = org, b = org + kImpellerTargetRange * v_forward;
traceline(a, b, MOVE_WORLDONLY, world);
if (trace_fraction == 1)
return;
end = trace_endpos;
vector x = find_closest(a, end, t.origin);
vector x = find_closest(a, end, hit.origin);

draw_beam(a, x, TE_LIGHTNING2);
draw_beam(x, t.origin, TE_LIGHTNING2);
draw_beam(x, hit.origin, TE_LIGHTNING2);

// Discount knockback by help given
mag -= max(10, vlen(t.origin - x));
mag -= max(10, vlen(hit.origin - x));
}

hit = t;
end = t.origin;
end = hit.origin;
}

deathmsg = DMSG_IMPELLER;
TF_T_Damage(hit, self, self, 5, TF_TD_NOTTEAM, TF_TD_ELECTRICITY | TF_TD_NOMOMENTUM);
hit.flags &= ~FL_ONGROUND;
hit.velocity -= mag * normalize(end - org);
if (other.has_flag)
if (hit.has_flag)
mag *= 2;
hit.velocity -= mag * normalize(end - org);
}

void () W_FireRailgun = {
Expand Down
5 changes: 0 additions & 5 deletions ssqc/qw.qc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ enum {
CT_FAST_PROJECTILE, // Fast proj => less judder (e.g. heavy bullet)
};

struct antilag_settings_t {
float rewind_detpipe;
} antilag_settings;

.vector antilag_origin;
.float last_death_ctime;
.float last_attack_ctime;

Expand Down
3 changes: 0 additions & 3 deletions ssqc/rewind.qc
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,6 @@ void RW_RestoreAll() {
float (string ps_short, string ps_setting, string ps_default) CF_GetSetting;

float RewindPlayersExceptSelf(float farthest_rewind_point) {
if (!antilag_settings.rewind_detpipe)
return FALSE;

float rewind_max_offset = (MAX_SNAPSHOTS - 1) * SERVER_FRAME_DT;
farthest_rewind_point = max(farthest_rewind_point,
time - rewind_max_offset);
Expand Down

0 comments on commit 949dfde

Please sign in to comment.