{
if(vlen(trace_endpos - fireBallisticBullet_trace_callback_ent.origin) > 16)
zcurveparticles_from_tracetoss(fireBallisticBullet_trace_callback_eff, fireBallisticBullet_trace_callback_ent.origin, trace_endpos, fireBallisticBullet_trace_callback_ent.velocity);
+ WarpZone_trace_forent = world;
}
void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
trace_fraction = 0;
fireBallisticBullet_trace_callback_ent = self;
fireBallisticBullet_trace_callback_eff = eff;
- // FIXME can we somehow do this with just ONE trace?
- WarpZone_TraceToss(self, self.owner);
- if(self.owner && WarpZone_trace_firstzone)
- {
- self.owner = world;
- self.velocity = v0;
- self.gravity = g0;
- continue;
- }
WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
self.velocity = v0;
self.gravity = g0;
entity wz;
vector vf, vr, vu;
+ WarpZone_trace_forent = forent;
WarpZone_trace_firstzone = world;
WarpZone_trace_lastzone = world;
WarpZone_Trace_InitTransform();
}
else
{
- tracebox(org, mi, ma, end, nomonsters, forent);
+ tracebox(org, mi, ma, end, nomonsters, WarpZone_trace_forent);
if(cb)
cb(org, trace_endpos, end);
return;
nomonsters_adjusted = nomonsters;
break;
}
- if((contentshack = (forent.dphitcontentsmask && !(forent.dphitcontentsmask & DPCONTENTS_SOLID))))
- BITSET_ASSIGN(forent.dphitcontentsmask, DPCONTENTS_SOLID);
+ if((contentshack = (WarpZone_trace_forent.dphitcontentsmask && !(WarpZone_trace_forent.dphitcontentsmask & DPCONTENTS_SOLID))))
+ BITSET_ASSIGN(WarpZone_trace_forent.dphitcontentsmask, DPCONTENTS_SOLID);
// if starting in warpzone, first transform
wz = WarpZone_Find(org + mi, org + ma);
trace_ent = world;
break;
}
- tracebox(org, mi, ma, end, nomonsters_adjusted, forent);
+ tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent);
if(cb)
cb(org, trace_endpos, end);
if(sol < 0)
break;
if(trace_ent.classname != "trigger_warpzone")
{
- if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent) || (contentshack && (trace_dphitcontents & forent.dphitcontentsmask) == DPCONTENTS_SOLID))
+ if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent) || (contentshack && (trace_dphitcontents & WarpZone_trace_forent.dphitcontentsmask) == DPCONTENTS_SOLID))
{
// continue the trace, ignoring this hit (we only care for warpzones)
org = trace_endpos + normalize(end - org);
end = WarpZone_TransformOrigin(wz, end);
// we got warped, so let's step back a bit
- tracebox(org, mi, ma, org + normalize(org - end) * 32, nomonsters_adjusted, forent);
+ tracebox(org, mi, ma, org + normalize(org - end) * 32, nomonsters_adjusted, WarpZone_trace_forent);
org = trace_endpos;
}
WarpZone_MakeAllOther();
:fail
if(contentshack)
- BITCLR_ASSIGN(forent.dphitcontentsmask, DPCONTENTS_SOLID);
+ BITCLR_ASSIGN(WarpZone_trace_forent.dphitcontentsmask, DPCONTENTS_SOLID);
trace_startsolid = sol;
v_forward = vf;
v_right = vr;
o0 = e.origin;
v0 = e.velocity;
+ WarpZone_trace_forent = forent;
WarpZone_trace_firstzone = world;
WarpZone_trace_lastzone = world;
WarpZone_Trace_InitTransform();
WarpZone_tracetoss_time = 0;
if(!warpzone_warpzones_exist)
{
- tracetoss(e, forent);
+ tracetoss(e, WarpZone_trace_forent);
if(cb)
cb(e.origin, trace_endpos, trace_endpos);
dt = vlen(e.origin - o0) / vlen(e.velocity);
trace_ent = world;
break;
}
- tracetoss(e, forent);
+ tracetoss(e, WarpZone_trace_forent);
if(cb)
cb(e.origin, trace_endpos, trace_endpos);
dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
// we got warped, so let's step back a bit
e.velocity = -e.velocity;
- tracetoss(e, forent);
+ tracetoss(e, WarpZone_trace_forent);
dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
WarpZone_tracetoss_time -= dt;
e.origin = trace_endpos;