2 .vector warpzone_save_origin;
3 .vector warpzone_save_angles;
4 .vector warpzone_save_eorigin;
5 .vector warpzone_save_eangles;
8 .vector warpzone_oldorigin, warpzone_oldvelocity, warpzone_oldangles;
9 .float warpzone_teleport_time;
10 .float warpzone_teleport_finishtime;
11 .entity warpzone_teleport_zone;
13 void WarpZone_StoreProjectileData(entity e)
15 e.warpzone_oldorigin = e.origin;
16 e.warpzone_oldvelocity = e.velocity;
17 e.warpzone_oldangles = e.angles;
20 void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity)
22 setorigin (player, to);
23 player.oldorigin = to; // for DP's unsticking
24 player.angles = to_angles;
25 player.fixangle = TRUE;
26 player.velocity = to_velocity;
28 BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
30 if(player.classname == "player")
31 BITCLR_ASSIGN(player.flags, FL_ONGROUND);
33 WarpZone_PostTeleportPlayer_Callback(player);
36 float WarpZone_Teleported_Send(entity to, float sf)
38 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
39 WriteCoord(MSG_ENTITY, self.angles_x);
40 WriteCoord(MSG_ENTITY, self.angles_y);
41 WriteCoord(MSG_ENTITY, self.angles_z);
45 #define WARPZONE_TELEPORT_FIXSOLID(ret) \
48 setorigin(player, o1 - player.view_ofs); \
49 if(WarpZoneLib_MoveOutOfSolid(player)) \
51 o1 = player.origin + player.view_ofs; \
52 setorigin(player, o0 - player.view_ofs); \
56 print("would have to put player in solid, won't do that\n"); \
57 setorigin(player, o0 - player.view_ofs); \
62 #define WARPZONE_TELEPORT_DOTELEPORT() \
65 WarpZone_RefSys_Add(player, wz); \
66 WarpZone_TeleportPlayer(wz, player, o1 - player.view_ofs, a1, v1); \
67 WarpZone_StoreProjectileData(player); \
68 player.warpzone_teleport_time = time; \
69 player.warpzone_teleport_finishtime = time; \
70 player.warpzone_teleport_zone = wz; \
74 float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
76 vector o0, a0, v0, o1, a1, v1, o10;
78 o0 = player.origin + player.view_ofs;
82 o10 = o1 = WarpZone_TransformOrigin(wz, o0);
83 v1 = WarpZone_TransformVelocity(wz, v0);
84 if(clienttype(player) != CLIENTTYPE_NOTACLIENT)
85 a1 = WarpZone_TransformVAngles(wz, player.v_angle);
87 a1 = WarpZone_TransformAngles(wz, a0);
89 if(f0 != 0 || f1 != 0)
91 // retry last move but behind the warpzone!
92 // we must first go back as far as we can, then forward again, to not cause double touch events!
94 tracebox(o1 - player.view_ofs + v1 * frametime * f1, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f0, MOVE_WORLDONLY, player);
99 tracebox(trace_endpos, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f1, MOVE_NORMAL, player); // this should get us through the warpzone
102 o1 = trace_endpos + player.view_ofs;
105 md = max(vlen(player.mins), vlen(player.maxs));
106 d = WarpZone_TargetPlaneDist(wz, o1);
107 dv = WarpZone_TargetPlaneDist(wz, v1);
109 o1 = o1 - v1 * (d / dv);
112 // put him inside solid
113 tracebox(o1 - player.view_ofs, player.mins, player.maxs, o1 - player.view_ofs, MOVE_NOMONSTERS, player);
115 WARPZONE_TELEPORT_FIXSOLID(0);
117 WARPZONE_TELEPORT_DOTELEPORT();
119 // prevent further teleports back
120 float dt = (o1 - o10) * v1 * (1 / (v1 * v1));
121 if(dt < sys_frametime)
122 player.warpzone_teleport_finishtime += sys_frametime - dt;
124 #ifndef WARPZONE_USE_FIXANGLE
125 if(player.classname == "player")
127 // instead of fixangle, send the transform to the client for smoother operation
128 player.fixangle = FALSE;
131 setmodel(ts, "null");
132 ts.SendEntity = WarpZone_Teleported_Send;
133 ts.SendFlags = 0xFFFFFF;
134 ts.drawonlytoclient = player;
135 ts.think = SUB_Remove;
136 ts.nextthink = time + 1;
139 ts.effects = EF_NODEPTHTEST;
140 ts.classname = "warpzone_teleported";
141 ts.angles = wz.warpzone_transform;
148 void WarpZone_Touch (void)
152 if(other.classname == "trigger_warpzone")
155 if(time <= other.warpzone_teleport_finishtime) // already teleported this frame
158 // FIXME needs a better check to know what is safe to teleport and what not
159 if(other.movetype == MOVETYPE_NONE || other.movetype == MOVETYPE_FOLLOW || other.tag_entity)
162 if(WarpZoneLib_ExactTrigger_Touch())
165 if(WarpZone_PlaneDist(self, other.origin + other.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
169 if(clienttype(other) == CLIENTTYPE_NOTACLIENT)
170 f = min(-1, -64 / vlen(other.velocity));
173 if(WarpZone_Teleport(self, other, f, 0))
178 save1 = self.target; self.target = string_null;
179 save2 = self.target3; self.target3 = string_null;
181 if not(self.target) self.target = save1;
182 if not(self.target3) self.target3 = save2;
186 save1 = self.target; self.target = string_null;
187 save2 = self.target2; self.target2 = string_null;
189 if not(self.target) self.target = save1;
190 if not(self.target2) self.target2 = save2;
195 dprint("WARPZONE FAIL AHAHAHAHAH))\n");
199 float WarpZone_Send(entity to, float sendflags)
202 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
204 // we must send this flag for clientside to match properly too
206 if(self.warpzone_isboxy)
208 if(self.warpzone_fadestart)
210 if(self.origin != '0 0 0')
212 WriteByte(MSG_ENTITY, f);
214 // we need THESE to render the warpzone (and cull properly)...
217 WriteCoord(MSG_ENTITY, self.origin_x);
218 WriteCoord(MSG_ENTITY, self.origin_y);
219 WriteCoord(MSG_ENTITY, self.origin_z);
222 WriteShort(MSG_ENTITY, self.modelindex);
223 WriteCoord(MSG_ENTITY, self.mins_x);
224 WriteCoord(MSG_ENTITY, self.mins_y);
225 WriteCoord(MSG_ENTITY, self.mins_z);
226 WriteCoord(MSG_ENTITY, self.maxs_x);
227 WriteCoord(MSG_ENTITY, self.maxs_y);
228 WriteCoord(MSG_ENTITY, self.maxs_z);
229 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
231 // we need THESE to calculate the proper transform
232 WriteCoord(MSG_ENTITY, self.warpzone_origin_x);
233 WriteCoord(MSG_ENTITY, self.warpzone_origin_y);
234 WriteCoord(MSG_ENTITY, self.warpzone_origin_z);
235 WriteCoord(MSG_ENTITY, self.warpzone_angles_x);
236 WriteCoord(MSG_ENTITY, self.warpzone_angles_y);
237 WriteCoord(MSG_ENTITY, self.warpzone_angles_z);
238 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_x);
239 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_y);
240 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_z);
241 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_x);
242 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_y);
243 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_z);
247 WriteShort(MSG_ENTITY, self.warpzone_fadestart);
248 WriteShort(MSG_ENTITY, self.warpzone_fadeend);
254 float WarpZone_Camera_Send(entity to, float sendflags)
257 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
259 if(self.warpzone_fadestart)
261 if(self.origin != '0 0 0')
263 WriteByte(MSG_ENTITY, f);
265 // we need THESE to render the warpzone (and cull properly)...
268 WriteCoord(MSG_ENTITY, self.origin_x);
269 WriteCoord(MSG_ENTITY, self.origin_y);
270 WriteCoord(MSG_ENTITY, self.origin_z);
273 WriteShort(MSG_ENTITY, self.modelindex);
274 WriteCoord(MSG_ENTITY, self.mins_x);
275 WriteCoord(MSG_ENTITY, self.mins_y);
276 WriteCoord(MSG_ENTITY, self.mins_z);
277 WriteCoord(MSG_ENTITY, self.maxs_x);
278 WriteCoord(MSG_ENTITY, self.maxs_y);
279 WriteCoord(MSG_ENTITY, self.maxs_z);
280 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
282 // we need THESE to calculate the proper transform
283 WriteCoord(MSG_ENTITY, self.enemy.origin_x);
284 WriteCoord(MSG_ENTITY, self.enemy.origin_y);
285 WriteCoord(MSG_ENTITY, self.enemy.origin_z);
286 WriteCoord(MSG_ENTITY, self.enemy.angles_x);
287 WriteCoord(MSG_ENTITY, self.enemy.angles_y);
288 WriteCoord(MSG_ENTITY, self.enemy.angles_z);
292 WriteShort(MSG_ENTITY, self.warpzone_fadestart);
293 WriteShort(MSG_ENTITY, self.warpzone_fadeend);
299 float WarpZone_CheckProjectileImpact(entity player)
303 o0 = player.origin + player.view_ofs;
304 v0 = player.velocity;
306 // if we teleported shortly before, abort
307 if(time <= player.warpzone_teleport_finishtime + 0.1)
310 // if player hit a warpzone, abort
312 wz = WarpZone_Find(o0 + player.mins, o0 + player.maxs);
316 print("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
318 // retry previous move
319 setorigin(player, player.warpzone_oldorigin);
320 player.velocity = player.warpzone_oldvelocity;
321 if(WarpZone_Teleport(wz, player, 0, 1))
331 save1 = self.target; self.target = string_null;
332 save2 = self.target3; self.target3 = string_null;
334 if not(self.target) self.target = save1;
335 if not(self.target3) self.target3 = save2;
338 save1 = self.target; self.target = string_null;
339 save2 = self.target2; self.target2 = string_null;
341 if not(self.target) self.target = save1;
342 if not(self.target2) self.target2 = save2;
347 setorigin(player, o0 - player.view_ofs);
348 player.velocity = v0;
353 float WarpZone_Projectile_Touch()
356 if(other.classname == "trigger_warpzone")
359 // no further impacts if we teleported this frame!
360 if(time == self.warpzone_teleport_time)
363 // this SEEMS to not happen at the moment, but if it did, it would be more reliable
365 float save_dpstartcontents;
366 float save_dphitcontents;
367 float save_dphitq3surfaceflags;
368 string save_dphittexturename;
370 float save_startsolid;
373 vector save_plane_normal;
374 float save_plane_dist;
378 save_dpstartcontents = trace_dpstartcontents;
379 save_dphitcontents = trace_dphitcontents;
380 save_dphitq3surfaceflags = trace_dphitq3surfaceflags;
381 save_dphittexturename = trace_dphittexturename;
382 save_allsolid = trace_allsolid;
383 save_startsolid = trace_startsolid;
384 save_fraction = trace_fraction;
385 save_endpos = trace_endpos;
386 save_plane_normal = trace_plane_normal;
387 save_plane_dist = trace_plane_dist;
388 save_ent = trace_ent;
389 save_inopen = trace_inopen;
390 save_inwater = trace_inwater;
391 if((f = WarpZone_CheckProjectileImpact(self)) != 0)
393 trace_dpstartcontents = save_dpstartcontents;
394 trace_dphitcontents = save_dphitcontents;
395 trace_dphitq3surfaceflags = save_dphitq3surfaceflags;
396 trace_dphittexturename = save_dphittexturename;
397 trace_allsolid = save_allsolid;
398 trace_startsolid = save_startsolid;
399 trace_fraction = save_fraction;
400 trace_endpos = save_endpos;
401 trace_plane_normal = save_plane_normal;
402 trace_plane_dist = save_plane_dist;
403 trace_ent = save_ent;
404 trace_inopen = save_inopen;
405 trace_inwater = save_inwater;
408 if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
414 void WarpZone_InitStep_FindOriginTarget()
416 if(self.killtarget != "")
418 self.aiment = find(world, targetname, self.killtarget);
419 if(self.aiment == world)
421 error("Warp zone with nonexisting killtarget");
424 self.killtarget = string_null;
428 void WarpZonePosition_InitStep_FindTarget()
430 if(self.target == "")
432 error("Warp zone position with no target");
435 self.enemy = find(world, targetname, self.target);
436 if(self.enemy == world)
438 error("Warp zone position with nonexisting target");
441 if(self.enemy.aiment)
443 // already is positioned
444 error("Warp zone position targeting already oriented warpzone");
447 self.enemy.aiment = self;
450 void WarpZoneCamera_Think(void)
452 if(self.warpzone_save_origin != self.origin
453 || self.warpzone_save_angles != self.angles
454 || self.warpzone_save_eorigin != self.enemy.origin
455 || self.warpzone_save_eangles != self.enemy.angles)
457 WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
458 self.warpzone_save_origin = self.origin;
459 self.warpzone_save_angles = self.angles;
460 self.warpzone_save_eorigin = self.enemy.origin;
461 self.warpzone_save_eangles = self.enemy.angles;
463 self.nextthink = time;
466 void WarpZoneCamera_InitStep_FindTarget()
470 if(self.target == "")
472 error("Camera with no target");
476 for(e = world, i = 0; (e = find(e, targetname, self.target)); )
477 if(random() * ++i < 1)
479 if(self.enemy == world)
481 error("Camera with nonexisting target");
484 warpzone_cameras_exist = 1;
485 WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
486 self.SendFlags = 0xFFFFFF;
487 if(self.spawnflags & 1)
489 self.think = WarpZoneCamera_Think;
490 self.nextthink = time;
496 void WarpZone_InitStep_UpdateTransform()
498 vector org, ang, norm, point;
500 vector tri, a, b, c, p, q, n;
506 org = 0.5 * (self.mins + self.maxs);
508 norm = point = '0 0 0';
510 for(i_s = 0; ; ++i_s)
512 tex = getsurfacetexture(self, i_s);
514 break; // this is beyond the last one
515 if(tex == "textures/common/trigger" || tex == "trigger")
517 n_t = getsurfacenumtriangles(self, i_s);
518 for(i_t = 0; i_t < n_t; ++i_t)
520 tri = getsurfacetriangle(self, i_s, i_t);
521 a = getsurfacepoint(self, i_s, tri_x);
522 b = getsurfacepoint(self, i_s, tri_y);
523 c = getsurfacepoint(self, i_s, tri_z);
526 n = '1 0 0' * (q_y * p_z - q_z * p_y)
527 + '0 1 0' * (q_z * p_x - q_x * p_z)
528 + '0 0 1' * (q_x * p_y - q_y * p_x);
529 area = area + vlen(n);
531 point = point + vlen(n) * (a + b + c);
536 norm = norm * (1 / area);
537 point = point * (1 / (3 * area));
538 if(vlen(norm) < 0.99)
540 print("trigger_warpzone near ", vtos(self.aiment.origin), " is nonplanar. BEWARE.\n");
541 area = 0; // no autofixing in this case
543 norm = normalize(norm);
548 org = self.aiment.origin;
549 ang = self.aiment.angles;
552 org = org - ((org - point) * norm) * norm; // project to plane
554 if(norm * v_forward < 0)
556 print("Position target of trigger_warpzone near ", vtos(self.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
559 ang = vectoangles(norm, v_up); // keep rotation, but turn exactly against plane
561 if(norm * v_forward < 0.99)
562 print("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
563 if(vlen(org - self.aiment.origin) > 0.5)
564 print("trigger_warpzone near ", vtos(self.aiment.origin), " has been moved to match the plane (", vtos(self.aiment.origin), " -> ", vtos(org), ").\n");
570 ang = vectoangles(norm);
574 error("cannot infer origin/angles for this warpzone, please use a killtarget or a trigger_warpzone_position");
576 self.warpzone_origin = org;
577 self.warpzone_angles = ang;
580 void WarpZone_InitStep_ClearTarget()
583 self.enemy.enemy = world;
587 entity warpzone_first; .entity warpzone_next;
588 void WarpZone_InitStep_FindTarget()
596 // this way only one of the two ents needs to target
597 if(self.target != "")
599 self.enemy = self; // so the if(!e.enemy) check also skips self, saves one IF
602 for(e = world, i = 0; (e = find(e, targetname, self.target)); )
604 if(e.classname == self.classname) // possibly non-warpzones may use the same targetname!
605 if(random() * ++i < 1)
610 error("Warpzone with non-existing target");
618 void WarpZone_Think();
619 void WarpZone_InitStep_FinalizeTransform()
621 if(!self.enemy || self.enemy.enemy != self)
623 error("Invalid warp zone detected. Killed.");
627 warpzone_warpzones_exist = 1;
628 WarpZone_SetUp(self, self.warpzone_origin, self.warpzone_angles, self.enemy.warpzone_origin, self.enemy.warpzone_angles);
629 self.touch = WarpZone_Touch;
630 self.SendFlags = 0xFFFFFF;
631 if(self.spawnflags & 1)
633 self.think = WarpZone_Think;
634 self.nextthink = time;
640 float warpzone_initialized;
641 entity warpzone_first;
642 entity warpzone_position_first;
643 entity warpzone_camera_first;
644 .entity warpzone_next;
645 void spawnfunc_misc_warpzone_position(void)
647 // "target", "angles", "origin"
648 self.warpzone_next = warpzone_position_first;
649 warpzone_position_first = self;
651 void spawnfunc_trigger_warpzone_position(void)
653 spawnfunc_misc_warpzone_position();
655 void spawnfunc_trigger_warpzone(void)
657 // warp zone entities must have:
658 // "killtarget" pointing to a target_position with a direction arrow
659 // that points AWAY from the warp zone, and that is inside
660 // the warp zone trigger
661 // "target" pointing to an identical warp zone at another place in
662 // the map, with another killtarget to designate its
665 #ifndef WARPZONE_USE_FIXANGLE
666 // used when teleporting
667 precache_model("null");
671 self.scale = self.modelscale;
676 WarpZoneLib_ExactTrigger_Init();
680 setmodel(self, m); // no precision needed
682 setorigin(self, self.origin);
684 setsize(self, self.mins * self.scale, self.maxs * self.scale);
686 setsize(self, self.mins, self.maxs);
687 self.SendEntity = WarpZone_Send;
688 self.SendFlags = 0xFFFFFF;
689 BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
690 self.warpzone_next = warpzone_first;
691 warpzone_first = self;
693 void spawnfunc_func_camera(void)
696 self.scale = self.modelscale;
701 precache_model(self.model);
702 setmodel(self, self.model); // no precision needed
704 setorigin(self, self.origin);
706 setsize(self, self.mins * self.scale, self.maxs * self.scale);
708 setsize(self, self.mins, self.maxs);
710 self.solid = SOLID_BSP;
711 else if(self.solid < 0)
712 self.solid = SOLID_NOT;
713 self.SendEntity = WarpZone_Camera_Send;
714 self.SendFlags = 0xFFFFFF;
715 self.warpzone_next = warpzone_camera_first;
716 warpzone_camera_first = self;
718 void WarpZones_Reconnect()
722 for(self = warpzone_first; self; self = self.warpzone_next)
723 WarpZone_InitStep_ClearTarget();
724 for(self = warpzone_first; self; self = self.warpzone_next)
725 WarpZone_InitStep_FindTarget();
726 for(self = warpzone_camera_first; self; self = self.warpzone_next)
727 WarpZoneCamera_InitStep_FindTarget();
728 for(self = warpzone_first; self; self = self.warpzone_next)
729 WarpZone_InitStep_FinalizeTransform();
733 void WarpZone_Think()
735 if(self.warpzone_save_origin != self.origin
736 || self.warpzone_save_angles != self.angles
737 || self.warpzone_save_eorigin != self.enemy.origin
738 || self.warpzone_save_eangles != self.enemy.angles)
742 WarpZone_InitStep_UpdateTransform();
744 WarpZone_InitStep_UpdateTransform();
746 WarpZone_InitStep_FinalizeTransform();
748 WarpZone_InitStep_FinalizeTransform();
750 self.warpzone_save_origin = self.origin;
751 self.warpzone_save_angles = self.angles;
752 self.warpzone_save_eorigin = self.enemy.origin;
753 self.warpzone_save_eangles = self.enemy.angles;
755 self.nextthink = time;
758 void WarpZone_StartFrame()
761 if(warpzone_initialized == 0)
763 warpzone_initialized = 1;
765 for(self = warpzone_first; self; self = self.warpzone_next)
766 WarpZone_InitStep_FindOriginTarget();
767 for(self = warpzone_position_first; self; self = self.warpzone_next)
768 WarpZonePosition_InitStep_FindTarget();
769 for(self = warpzone_first; self; self = self.warpzone_next)
770 WarpZone_InitStep_UpdateTransform();
772 WarpZones_Reconnect();
773 WarpZone_PostInitialize_Callback();
776 entity oldself, oldother;
779 for(e = world; (e = nextent(e)); )
781 if(warpzone_warpzones_exist) { WarpZone_StoreProjectileData(e); }
783 float f = clienttype(e);
784 if(f == CLIENTTYPE_REAL)
786 if(e.solid == SOLID_NOT) // not spectating?
787 if(e.movetype == MOVETYPE_NOCLIP || e.movetype == MOVETYPE_FLY || e.movetype == MOVETYPE_FLY_WORLDONLY) // not spectating? (this is to catch observers)
792 if(warpzone_warpzones_exist) {
793 self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
795 if(!WarpZoneLib_ExactTrigger_Touch())
796 if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
797 WarpZone_Teleport(self, e, -1, 0); } // NOT triggering targets by this!
800 self = Teleport_Find(e.origin + e.mins, e.origin + e.maxs);
802 if(!WarpZoneLib_ExactTrigger_Touch())
803 Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
807 if(f == CLIENTTYPE_NOTACLIENT)
809 if(warpzone_warpzones_exist)
810 for(; (e = nextent(e)); )
811 WarpZone_StoreProjectileData(e);
819 .float warpzone_reconnecting;
820 float visible_to_some_client(entity ent)
823 for(e = nextent(world); clienttype(e) != CLIENTTYPE_NOTACLIENT; e = nextent(e))
824 if(e.classname == "player" && clienttype(e) == CLIENTTYPE_REAL)
825 if(checkpvs(e.origin + e.view_ofs, ent))
829 void trigger_warpzone_reconnect_use()
833 // NOTE: this matches for target, not targetname, but of course
834 // targetname must be set too on the other entities
835 for(self = warpzone_first; self; self = self.warpzone_next)
836 self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && (visible_to_some_client(self) || visible_to_some_client(self.enemy))));
837 for(self = warpzone_camera_first; self; self = self.warpzone_next)
838 self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && visible_to_some_client(self)));
839 for(self = warpzone_first; self; self = self.warpzone_next)
840 if(self.warpzone_reconnecting)
841 WarpZone_InitStep_ClearTarget();
842 for(self = warpzone_first; self; self = self.warpzone_next)
843 if(self.warpzone_reconnecting)
844 WarpZone_InitStep_FindTarget();
845 for(self = warpzone_camera_first; self; self = self.warpzone_next)
846 if(self.warpzone_reconnecting)
847 WarpZoneCamera_InitStep_FindTarget();
848 for(self = warpzone_first; self; self = self.warpzone_next)
849 if(self.warpzone_reconnecting || self.enemy.warpzone_reconnecting)
850 WarpZone_InitStep_FinalizeTransform();
854 void spawnfunc_trigger_warpzone_reconnect()
856 self.use = trigger_warpzone_reconnect_use;
859 void spawnfunc_target_warpzone_reconnect()
861 spawnfunc_trigger_warpzone_reconnect(); // both names make sense here :(
864 void WarpZone_PlayerPhysics_FixVAngle(void)
866 #ifndef WARPZONE_DONT_FIX_VANGLE
867 if(clienttype(self) == CLIENTTYPE_REAL)
868 if(self.v_angle_z <= 360) // if not already adjusted
869 if(time - self.ping * 0.001 < self.warpzone_teleport_time)
871 self.v_angle = WarpZone_TransformVAngles(self.warpzone_teleport_zone, self.v_angle);
872 self.v_angle_z += 720; // mark as adjusted