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 .entity warpzone_teleport_zone;
12 void WarpZone_StoreProjectileData(entity e)
14 e.warpzone_oldorigin = e.origin;
15 e.warpzone_oldvelocity = e.velocity;
16 e.warpzone_oldangles = e.angles;
19 void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity)
21 setorigin (player, to);
22 player.oldorigin = to; // for DP's unsticking
23 player.angles = to_angles;
24 player.fixangle = TRUE;
25 player.velocity = to_velocity;
27 BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
29 if(player.classname == "player")
30 BITCLR_ASSIGN(player.flags, FL_ONGROUND);
32 WarpZone_PostTeleportPlayer_Callback(player);
35 float WarpZone_Teleported_Send(entity to, float sf)
37 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
38 WriteCoord(MSG_ENTITY, self.angles_x);
39 WriteCoord(MSG_ENTITY, self.angles_y);
40 WriteCoord(MSG_ENTITY, self.angles_z);
44 #define WARPZONE_TELEPORT_FIXSOLID(ret) \
46 setorigin(player, o1 - player.view_ofs); \
47 if(WarpZoneLib_MoveOutOfSolid(player)) \
49 o1 = player.origin + player.view_ofs; \
50 setorigin(player, o0 - player.view_ofs); \
54 print("would have to put player in solid, won't do that\n"); \
55 setorigin(player, o0 - player.view_ofs); \
59 #define WARPZONE_TELEPORT_DOTELEPORT() \
61 WarpZone_RefSys_Add(player, wz); \
62 WarpZone_TeleportPlayer(wz, player, o1 - player.view_ofs, a1, v1); \
63 WarpZone_StoreProjectileData(player); \
64 player.warpzone_teleport_time = time; \
65 player.warpzone_teleport_zone = wz; \
68 float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
70 vector o0, a0, v0, o1, a1, v1;
72 o0 = player.origin + player.view_ofs;
76 o1 = WarpZone_TransformOrigin(wz, o0);
77 v1 = WarpZone_TransformVelocity(wz, v0);
78 if(clienttype(player) != CLIENTTYPE_NOTACLIENT)
79 a1 = WarpZone_TransformVAngles(wz, player.v_angle);
81 a1 = WarpZone_TransformAngles(wz, a0);
83 if(f0 != 0 || f1 != 0)
85 // retry last move but behind the warpzone!
86 // we must first go back as far as we can, then forward again, to not cause double touch events!
88 tracebox(o1 - player.view_ofs + v1 * frametime * f1, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f0, MOVE_WORLDONLY, player);
93 tracebox(trace_endpos, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f1, MOVE_NORMAL, player); // this should get us through the warpzone
96 o1 = trace_endpos + player.view_ofs;
99 d = WarpZone_TargetPlaneDist(wz, o1);
100 dv = WarpZone_TargetPlaneDist(wz, v1);
102 o1 = o1 - v1 * (d / dv);
105 // put him inside solid
106 tracebox(o1 - player.view_ofs, player.mins, player.maxs, o1 - player.view_ofs, MOVE_NOMONSTERS, player);
108 WARPZONE_TELEPORT_FIXSOLID(0);
110 WARPZONE_TELEPORT_DOTELEPORT();
112 #ifndef WARPZONE_USE_FIXANGLE
113 if(player.classname == "player")
115 // instead of fixangle, send the transform to the client for smoother operation
116 player.fixangle = FALSE;
119 setmodel(ts, "null");
120 ts.SendEntity = WarpZone_Teleported_Send;
121 ts.SendFlags = 0xFFFFFF;
122 ts.drawonlytoclient = player;
123 ts.think = SUB_Remove;
124 ts.nextthink = time + 1;
127 ts.effects = EF_NODEPTHTEST;
128 ts.classname = "warpzone_teleported";
129 ts.angles = wz.warpzone_transform;
136 void WarpZone_Touch (void)
140 if(other.classname == "trigger_warpzone")
143 if(other.warpzone_teleport_time == time) // already teleported this frame
146 // FIXME needs a better check to know what is safe to teleport and what not
147 if(other.movetype == MOVETYPE_NONE || other.movetype == MOVETYPE_FOLLOW)
150 if(WarpZoneLib_ExactTrigger_Touch())
153 if(WarpZone_PlaneDist(self, other.origin + other.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
156 if(WarpZone_Teleport(self, other, -1, 0))
161 save1 = self.target; self.target = string_null;
162 save2 = self.target3; self.target3 = string_null;
164 if not(self.target) self.target = save1;
165 if not(self.target3) self.target3 = save2;
169 save1 = self.target; self.target = string_null;
170 save2 = self.target2; self.target2 = string_null;
172 if not(self.target) self.target = save1;
173 if not(self.target2) self.target2 = save2;
178 dprint("WARPZONE FAIL AHAHAHAHAH))\n");
182 float WarpZone_Send(entity to, float sendflags)
185 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
187 // we must send this flag for clientside to match properly too
189 if(self.warpzone_isboxy)
191 if(self.warpzone_fadestart)
193 if(self.origin != '0 0 0')
195 WriteByte(MSG_ENTITY, f);
197 // we need THESE to render the warpzone (and cull properly)...
200 WriteCoord(MSG_ENTITY, self.origin_x);
201 WriteCoord(MSG_ENTITY, self.origin_y);
202 WriteCoord(MSG_ENTITY, self.origin_z);
205 WriteShort(MSG_ENTITY, self.modelindex);
206 WriteCoord(MSG_ENTITY, self.mins_x);
207 WriteCoord(MSG_ENTITY, self.mins_y);
208 WriteCoord(MSG_ENTITY, self.mins_z);
209 WriteCoord(MSG_ENTITY, self.maxs_x);
210 WriteCoord(MSG_ENTITY, self.maxs_y);
211 WriteCoord(MSG_ENTITY, self.maxs_z);
212 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
214 // we need THESE to calculate the proper transform
215 WriteCoord(MSG_ENTITY, self.warpzone_origin_x);
216 WriteCoord(MSG_ENTITY, self.warpzone_origin_y);
217 WriteCoord(MSG_ENTITY, self.warpzone_origin_z);
218 WriteCoord(MSG_ENTITY, self.warpzone_angles_x);
219 WriteCoord(MSG_ENTITY, self.warpzone_angles_y);
220 WriteCoord(MSG_ENTITY, self.warpzone_angles_z);
221 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_x);
222 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_y);
223 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_z);
224 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_x);
225 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_y);
226 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_z);
230 WriteShort(MSG_ENTITY, self.warpzone_fadestart);
231 WriteShort(MSG_ENTITY, self.warpzone_fadeend);
237 float WarpZone_Camera_Send(entity to, float sendflags)
240 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
242 if(self.warpzone_fadestart)
244 if(self.origin != '0 0 0')
246 WriteByte(MSG_ENTITY, f);
248 // we need THESE to render the warpzone (and cull properly)...
251 WriteCoord(MSG_ENTITY, self.origin_x);
252 WriteCoord(MSG_ENTITY, self.origin_y);
253 WriteCoord(MSG_ENTITY, self.origin_z);
256 WriteShort(MSG_ENTITY, self.modelindex);
257 WriteCoord(MSG_ENTITY, self.mins_x);
258 WriteCoord(MSG_ENTITY, self.mins_y);
259 WriteCoord(MSG_ENTITY, self.mins_z);
260 WriteCoord(MSG_ENTITY, self.maxs_x);
261 WriteCoord(MSG_ENTITY, self.maxs_y);
262 WriteCoord(MSG_ENTITY, self.maxs_z);
263 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
265 // we need THESE to calculate the proper transform
266 WriteCoord(MSG_ENTITY, self.enemy.origin_x);
267 WriteCoord(MSG_ENTITY, self.enemy.origin_y);
268 WriteCoord(MSG_ENTITY, self.enemy.origin_z);
269 WriteCoord(MSG_ENTITY, self.enemy.angles_x);
270 WriteCoord(MSG_ENTITY, self.enemy.angles_y);
271 WriteCoord(MSG_ENTITY, self.enemy.angles_z);
275 WriteShort(MSG_ENTITY, self.warpzone_fadestart);
276 WriteShort(MSG_ENTITY, self.warpzone_fadeend);
282 float WarpZone_CheckProjectileImpact()
286 vector o0, a0, v0, o1, a1, v1;
288 o0 = player.origin + player.view_ofs;
289 v0 = player.velocity;
292 // if player hit a warpzone, abort
295 wz = WarpZone_Find(o0 + player.mins, o0 + player.maxs);
298 if(player.warpzone_teleport_time == time)
300 // just ignore if we got teleported this frame already and now hit a wall and are in a warpzone again (this will cause a detonation)
301 // print("2 warps 1 frame\n");
305 // retry previous move
306 setorigin(player, player.warpzone_oldorigin);
307 player.velocity = player.warpzone_oldvelocity;
308 if(WarpZone_Teleport(wz, player, 0, 1))
310 print(sprintf("teleported by impact filter!\n"));
314 setorigin(player, o0);
315 player.velocity = v0;
320 float WarpZone_Projectile_Touch()
323 if(other.classname == "trigger_warpzone")
326 // no further impacts if we teleported this frame!
327 if(self.warpzone_teleport_time == time)
332 float save_dpstartcontents;
333 float save_dphitcontents;
334 float save_dphitq3surfaceflags;
335 string save_dphittexturename;
337 float save_startsolid;
340 vector save_plane_normal;
341 float save_plane_dist;
345 save_dpstartcontents = trace_dpstartcontents;
346 save_dphitcontents = trace_dphitcontents;
347 save_dphitq3surfaceflags = trace_dphitq3surfaceflags;
348 save_dphittexturename = trace_dphittexturename;
349 save_allsolid = trace_allsolid;
350 save_startsolid = trace_startsolid;
351 save_fraction = trace_fraction;
352 save_endpos = trace_endpos;
353 save_plane_normal = trace_plane_normal;
354 save_plane_dist = trace_plane_dist;
355 save_ent = trace_ent;
356 save_inopen = trace_inopen;
357 save_inwater = trace_inwater;
358 if((f = WarpZone_CheckProjectileImpact()) != 0)
360 trace_dpstartcontents = save_dpstartcontents;
361 trace_dphitcontents = save_dphitcontents;
362 trace_dphitq3surfaceflags = save_dphitq3surfaceflags;
363 trace_dphittexturename = save_dphittexturename;
364 trace_allsolid = save_allsolid;
365 trace_startsolid = save_startsolid;
366 trace_fraction = save_fraction;
367 trace_endpos = save_endpos;
368 trace_plane_normal = save_plane_normal;
369 trace_plane_dist = save_plane_dist;
370 trace_ent = save_ent;
371 trace_inopen = save_inopen;
372 trace_inwater = save_inwater;
376 if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
379 if(self.warpzone_teleport_time == time)
381 // sequence: hit warpzone, get teleported, hit wall
382 // print("2 hits 1 frame\n");
383 setorigin(self, self.warpzone_oldorigin);
384 self.velocity = self.warpzone_oldvelocity;
385 self.angles = self.warpzone_oldangles;
391 void WarpZone_InitStep_FindOriginTarget()
393 if(self.killtarget != "")
395 self.aiment = find(world, targetname, self.killtarget);
396 if(self.aiment == world)
398 error("Warp zone with nonexisting killtarget");
401 self.killtarget = string_null;
405 void WarpZonePosition_InitStep_FindTarget()
407 if(self.target == "")
409 error("Warp zone position with no target");
412 self.enemy = find(world, targetname, self.target);
413 if(self.enemy == world)
415 error("Warp zone position with nonexisting target");
418 if(self.enemy.aiment)
420 // already is positioned
421 error("Warp zone position targeting already oriented warpzone");
424 self.enemy.aiment = self;
427 void WarpZoneCamera_Think(void)
429 if(self.warpzone_save_origin != self.origin
430 || self.warpzone_save_angles != self.angles
431 || self.warpzone_save_eorigin != self.enemy.origin
432 || self.warpzone_save_eangles != self.enemy.angles)
434 WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
435 self.warpzone_save_origin = self.origin;
436 self.warpzone_save_angles = self.angles;
437 self.warpzone_save_eorigin = self.enemy.origin;
438 self.warpzone_save_eangles = self.enemy.angles;
440 self.nextthink = time;
443 void WarpZoneCamera_InitStep_FindTarget()
447 if(self.target == "")
449 error("Camera with no target");
453 for(e = world, i = 0; (e = find(e, targetname, self.target)); )
454 if(random() * ++i < 1)
456 if(self.enemy == world)
458 error("Camera with nonexisting target");
461 warpzone_cameras_exist = 1;
462 WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
463 self.SendFlags = 0xFFFFFF;
464 if(self.spawnflags & 1)
466 self.think = WarpZoneCamera_Think;
467 self.nextthink = time;
473 void WarpZone_InitStep_UpdateTransform()
475 vector org, ang, norm, point;
477 vector tri, a, b, c, p, q, n;
483 org = 0.5 * (self.mins + self.maxs);
485 norm = point = '0 0 0';
487 for(i_s = 0; ; ++i_s)
489 tex = getsurfacetexture(self, i_s);
491 break; // this is beyond the last one
492 if(tex == "textures/common/trigger" || tex == "trigger")
494 n_t = getsurfacenumtriangles(self, i_s);
495 for(i_t = 0; i_t < n_t; ++i_t)
497 tri = getsurfacetriangle(self, i_s, i_t);
498 a = getsurfacepoint(self, i_s, tri_x);
499 b = getsurfacepoint(self, i_s, tri_y);
500 c = getsurfacepoint(self, i_s, tri_z);
503 n = '1 0 0' * (q_y * p_z - q_z * p_y)
504 + '0 1 0' * (q_z * p_x - q_x * p_z)
505 + '0 0 1' * (q_x * p_y - q_y * p_x);
506 area = area + vlen(n);
508 point = point + vlen(n) * (a + b + c);
513 norm = norm * (1 / area);
514 point = point * (1 / (3 * area));
515 if(vlen(norm) < 0.99)
517 print("trigger_warpzone near ", vtos(self.aiment.origin), " is nonplanar. BEWARE.\n");
518 area = 0; // no autofixing in this case
520 norm = normalize(norm);
525 org = self.aiment.origin;
526 ang = self.aiment.angles;
529 org = org - ((org - point) * norm) * norm; // project to plane
531 if(norm * v_forward < 0)
533 print("Position target of trigger_warpzone near ", vtos(self.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
536 ang = vectoangles(norm, v_up); // keep rotation, but turn exactly against plane
538 if(norm * v_forward < 0.99)
539 print("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
540 if(vlen(org - self.aiment.origin) > 0.5)
541 print("trigger_warpzone near ", vtos(self.aiment.origin), " has been moved to match the plane (", vtos(self.aiment.origin), " -> ", vtos(org), ").\n");
547 ang = vectoangles(norm);
551 error("cannot infer origin/angles for this warpzone, please use a killtarget or a trigger_warpzone_position");
553 self.warpzone_origin = org;
554 self.warpzone_angles = ang;
557 void WarpZone_InitStep_ClearTarget()
560 self.enemy.enemy = world;
564 entity warpzone_first; .entity warpzone_next;
565 void WarpZone_InitStep_FindTarget()
573 // this way only one of the two ents needs to target
574 if(self.target != "")
576 self.enemy = self; // so the if(!e.enemy) check also skips self, saves one IF
579 for(e = world, i = 0; (e = find(e, targetname, self.target)); )
581 if(e.classname == self.classname) // possibly non-warpzones may use the same targetname!
582 if(random() * ++i < 1)
587 error("Warpzone with non-existing target");
595 void WarpZone_Think();
596 void WarpZone_InitStep_FinalizeTransform()
598 if(!self.enemy || self.enemy.enemy != self)
600 error("Invalid warp zone detected. Killed.");
604 warpzone_warpzones_exist = 1;
605 WarpZone_SetUp(self, self.warpzone_origin, self.warpzone_angles, self.enemy.warpzone_origin, self.enemy.warpzone_angles);
606 self.touch = WarpZone_Touch;
607 self.SendFlags = 0xFFFFFF;
608 if(self.spawnflags & 1)
610 self.think = WarpZone_Think;
611 self.nextthink = time;
617 float warpzone_initialized;
618 entity warpzone_first;
619 entity warpzone_position_first;
620 entity warpzone_camera_first;
621 .entity warpzone_next;
622 void spawnfunc_misc_warpzone_position(void)
624 // "target", "angles", "origin"
625 self.warpzone_next = warpzone_position_first;
626 warpzone_position_first = self;
628 void spawnfunc_trigger_warpzone_position(void)
630 spawnfunc_misc_warpzone_position();
632 void spawnfunc_trigger_warpzone(void)
634 // warp zone entities must have:
635 // "killtarget" pointing to a target_position with a direction arrow
636 // that points AWAY from the warp zone, and that is inside
637 // the warp zone trigger
638 // "target" pointing to an identical warp zone at another place in
639 // the map, with another killtarget to designate its
642 #ifndef WARPZONE_USE_FIXANGLE
643 // used when teleporting
644 precache_model("null");
648 self.scale = self.modelscale;
653 WarpZoneLib_ExactTrigger_Init();
657 setmodel(self, m); // no precision needed
659 setorigin(self, self.origin);
661 setsize(self, self.mins * self.scale, self.maxs * self.scale);
663 setsize(self, self.mins, self.maxs);
664 self.SendEntity = WarpZone_Send;
665 self.SendFlags = 0xFFFFFF;
666 BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
667 self.warpzone_next = warpzone_first;
668 warpzone_first = self;
670 void spawnfunc_func_camera(void)
673 self.scale = self.modelscale;
678 precache_model(self.model);
679 setmodel(self, self.model); // no precision needed
681 setorigin(self, self.origin);
683 setsize(self, self.mins * self.scale, self.maxs * self.scale);
685 setsize(self, self.mins, self.maxs);
687 self.solid = SOLID_BSP;
688 else if(self.solid < 0)
689 self.solid = SOLID_NOT;
690 self.SendEntity = WarpZone_Camera_Send;
691 self.SendFlags = 0xFFFFFF;
692 self.warpzone_next = warpzone_camera_first;
693 warpzone_camera_first = self;
695 void WarpZones_Reconnect()
699 for(self = warpzone_first; self; self = self.warpzone_next)
700 WarpZone_InitStep_ClearTarget();
701 for(self = warpzone_first; self; self = self.warpzone_next)
702 WarpZone_InitStep_FindTarget();
703 for(self = warpzone_camera_first; self; self = self.warpzone_next)
704 WarpZoneCamera_InitStep_FindTarget();
705 for(self = warpzone_first; self; self = self.warpzone_next)
706 WarpZone_InitStep_FinalizeTransform();
710 void WarpZone_Think()
712 if(self.warpzone_save_origin != self.origin
713 || self.warpzone_save_angles != self.angles
714 || self.warpzone_save_eorigin != self.enemy.origin
715 || self.warpzone_save_eangles != self.enemy.angles)
719 WarpZone_InitStep_UpdateTransform();
721 WarpZone_InitStep_UpdateTransform();
723 WarpZone_InitStep_FinalizeTransform();
725 WarpZone_InitStep_FinalizeTransform();
727 self.warpzone_save_origin = self.origin;
728 self.warpzone_save_angles = self.angles;
729 self.warpzone_save_eorigin = self.enemy.origin;
730 self.warpzone_save_eangles = self.enemy.angles;
732 self.nextthink = time;
735 void WarpZone_StartFrame()
738 if(warpzone_initialized == 0)
740 warpzone_initialized = 1;
742 for(self = warpzone_first; self; self = self.warpzone_next)
743 WarpZone_InitStep_FindOriginTarget();
744 for(self = warpzone_position_first; self; self = self.warpzone_next)
745 WarpZonePosition_InitStep_FindTarget();
746 for(self = warpzone_first; self; self = self.warpzone_next)
747 WarpZone_InitStep_UpdateTransform();
749 WarpZones_Reconnect();
752 if(warpzone_warpzones_exist)
754 entity oldself, oldother;
757 for(e = world; (e = nextent(e)); )
759 WarpZone_StoreProjectileData(e);
762 if(f == CLIENTTYPE_REAL)
764 if(e.solid != SOLID_NOT) // not spectating?
766 if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
768 self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
772 if(WarpZoneLib_ExactTrigger_Touch())
774 if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
775 WarpZone_Teleport(self, e); // NOT triggering targets by this!
777 if(f == CLIENTTYPE_NOTACLIENT)
779 for(; (e = nextent(e)); )
780 WarpZone_StoreProjectileData(e);
789 .float warpzone_reconnecting;
790 float visible_to_some_client(entity ent)
793 for(e = nextent(world); clienttype(e) != CLIENTTYPE_NOTACLIENT; e = nextent(e))
794 if(e.classname == "player" && clienttype(e) == CLIENTTYPE_REAL)
795 if(checkpvs(e.origin + e.view_ofs, ent))
799 void trigger_warpzone_reconnect_use()
803 // NOTE: this matches for target, not targetname, but of course
804 // targetname must be set too on the other entities
805 for(self = warpzone_first; self; self = self.warpzone_next)
806 self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && (visible_to_some_client(self) || visible_to_some_client(self.enemy))));
807 for(self = warpzone_camera_first; self; self = self.warpzone_next)
808 self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && visible_to_some_client(self)));
809 for(self = warpzone_first; self; self = self.warpzone_next)
810 if(self.warpzone_reconnecting)
811 WarpZone_InitStep_ClearTarget();
812 for(self = warpzone_first; self; self = self.warpzone_next)
813 if(self.warpzone_reconnecting)
814 WarpZone_InitStep_FindTarget();
815 for(self = warpzone_camera_first; self; self = self.warpzone_next)
816 if(self.warpzone_reconnecting)
817 WarpZoneCamera_InitStep_FindTarget();
818 for(self = warpzone_first; self; self = self.warpzone_next)
819 if(self.warpzone_reconnecting || self.enemy.warpzone_reconnecting)
820 WarpZone_InitStep_FinalizeTransform();
824 void spawnfunc_trigger_warpzone_reconnect()
826 self.use = trigger_warpzone_reconnect_use;
829 void spawnfunc_target_warpzone_reconnect()
831 spawnfunc_trigger_warpzone_reconnect(); // both names make sense here :(
834 void WarpZone_PlayerPhysics_FixVAngle(void)
836 #ifndef WARPZONE_DONT_FIX_VANGLE
837 if(clienttype(self) == CLIENTTYPE_REAL)
838 if(self.v_angle_z <= 360) // if not already adjusted
839 if(time - self.ping * 0.001 < self.warpzone_teleport_time)
841 self.v_angle = WarpZone_TransformVAngles(self.warpzone_teleport_zone, self.v_angle);
842 self.v_angle_z += 720; // mark as adjusted