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)
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)
168 if(WarpZone_Teleport(self, other, -1000, 0))
173 save1 = self.target; self.target = string_null;
174 save2 = self.target3; self.target3 = string_null;
176 if not(self.target) self.target = save1;
177 if not(self.target3) self.target3 = save2;
181 save1 = self.target; self.target = string_null;
182 save2 = self.target2; self.target2 = string_null;
184 if not(self.target) self.target = save1;
185 if not(self.target2) self.target2 = save2;
190 dprint("WARPZONE FAIL AHAHAHAHAH))\n");
194 float WarpZone_Send(entity to, float sendflags)
197 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
199 // we must send this flag for clientside to match properly too
201 if(self.warpzone_isboxy)
203 if(self.warpzone_fadestart)
205 if(self.origin != '0 0 0')
207 WriteByte(MSG_ENTITY, f);
209 // we need THESE to render the warpzone (and cull properly)...
212 WriteCoord(MSG_ENTITY, self.origin_x);
213 WriteCoord(MSG_ENTITY, self.origin_y);
214 WriteCoord(MSG_ENTITY, self.origin_z);
217 WriteShort(MSG_ENTITY, self.modelindex);
218 WriteCoord(MSG_ENTITY, self.mins_x);
219 WriteCoord(MSG_ENTITY, self.mins_y);
220 WriteCoord(MSG_ENTITY, self.mins_z);
221 WriteCoord(MSG_ENTITY, self.maxs_x);
222 WriteCoord(MSG_ENTITY, self.maxs_y);
223 WriteCoord(MSG_ENTITY, self.maxs_z);
224 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
226 // we need THESE to calculate the proper transform
227 WriteCoord(MSG_ENTITY, self.warpzone_origin_x);
228 WriteCoord(MSG_ENTITY, self.warpzone_origin_y);
229 WriteCoord(MSG_ENTITY, self.warpzone_origin_z);
230 WriteCoord(MSG_ENTITY, self.warpzone_angles_x);
231 WriteCoord(MSG_ENTITY, self.warpzone_angles_y);
232 WriteCoord(MSG_ENTITY, self.warpzone_angles_z);
233 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_x);
234 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_y);
235 WriteCoord(MSG_ENTITY, self.warpzone_targetorigin_z);
236 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_x);
237 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_y);
238 WriteCoord(MSG_ENTITY, self.warpzone_targetangles_z);
242 WriteShort(MSG_ENTITY, self.warpzone_fadestart);
243 WriteShort(MSG_ENTITY, self.warpzone_fadeend);
249 float WarpZone_Camera_Send(entity to, float sendflags)
252 WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
254 if(self.warpzone_fadestart)
256 if(self.origin != '0 0 0')
258 WriteByte(MSG_ENTITY, f);
260 // we need THESE to render the warpzone (and cull properly)...
263 WriteCoord(MSG_ENTITY, self.origin_x);
264 WriteCoord(MSG_ENTITY, self.origin_y);
265 WriteCoord(MSG_ENTITY, self.origin_z);
268 WriteShort(MSG_ENTITY, self.modelindex);
269 WriteCoord(MSG_ENTITY, self.mins_x);
270 WriteCoord(MSG_ENTITY, self.mins_y);
271 WriteCoord(MSG_ENTITY, self.mins_z);
272 WriteCoord(MSG_ENTITY, self.maxs_x);
273 WriteCoord(MSG_ENTITY, self.maxs_y);
274 WriteCoord(MSG_ENTITY, self.maxs_z);
275 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
277 // we need THESE to calculate the proper transform
278 WriteCoord(MSG_ENTITY, self.enemy.origin_x);
279 WriteCoord(MSG_ENTITY, self.enemy.origin_y);
280 WriteCoord(MSG_ENTITY, self.enemy.origin_z);
281 WriteCoord(MSG_ENTITY, self.enemy.angles_x);
282 WriteCoord(MSG_ENTITY, self.enemy.angles_y);
283 WriteCoord(MSG_ENTITY, self.enemy.angles_z);
287 WriteShort(MSG_ENTITY, self.warpzone_fadestart);
288 WriteShort(MSG_ENTITY, self.warpzone_fadeend);
294 float WarpZone_CheckProjectileImpact(entity player)
298 o0 = player.origin + player.view_ofs;
299 v0 = player.velocity;
301 // if we teleported shortly before, abort
302 if(time <= player.warpzone_teleport_finishtime + 0.1)
305 // if player hit a warpzone, abort
307 wz = WarpZone_Find(o0 + player.mins, o0 + player.maxs);
311 print("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
313 // retry previous move
314 setorigin(player, player.warpzone_oldorigin);
315 player.velocity = player.warpzone_oldvelocity;
316 if(WarpZone_Teleport(wz, player, 0, 1))
326 save1 = self.target; self.target = string_null;
327 save2 = self.target3; self.target3 = string_null;
329 if not(self.target) self.target = save1;
330 if not(self.target3) self.target3 = save2;
333 save1 = self.target; self.target = string_null;
334 save2 = self.target2; self.target2 = string_null;
336 if not(self.target) self.target = save1;
337 if not(self.target2) self.target2 = save2;
342 setorigin(player, o0 - player.view_ofs);
343 player.velocity = v0;
348 float WarpZone_Projectile_Touch()
351 if(other.classname == "trigger_warpzone")
354 // no further impacts if we teleported this frame!
355 if(time == self.warpzone_teleport_time)
358 // this SEEMS to not happen at the moment, but if it did, it would be more reliable
360 float save_dpstartcontents;
361 float save_dphitcontents;
362 float save_dphitq3surfaceflags;
363 string save_dphittexturename;
365 float save_startsolid;
368 vector save_plane_normal;
369 float save_plane_dist;
373 save_dpstartcontents = trace_dpstartcontents;
374 save_dphitcontents = trace_dphitcontents;
375 save_dphitq3surfaceflags = trace_dphitq3surfaceflags;
376 save_dphittexturename = trace_dphittexturename;
377 save_allsolid = trace_allsolid;
378 save_startsolid = trace_startsolid;
379 save_fraction = trace_fraction;
380 save_endpos = trace_endpos;
381 save_plane_normal = trace_plane_normal;
382 save_plane_dist = trace_plane_dist;
383 save_ent = trace_ent;
384 save_inopen = trace_inopen;
385 save_inwater = trace_inwater;
386 if((f = WarpZone_CheckProjectileImpact(self)) != 0)
388 trace_dpstartcontents = save_dpstartcontents;
389 trace_dphitcontents = save_dphitcontents;
390 trace_dphitq3surfaceflags = save_dphitq3surfaceflags;
391 trace_dphittexturename = save_dphittexturename;
392 trace_allsolid = save_allsolid;
393 trace_startsolid = save_startsolid;
394 trace_fraction = save_fraction;
395 trace_endpos = save_endpos;
396 trace_plane_normal = save_plane_normal;
397 trace_plane_dist = save_plane_dist;
398 trace_ent = save_ent;
399 trace_inopen = save_inopen;
400 trace_inwater = save_inwater;
403 if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
409 void WarpZone_InitStep_FindOriginTarget()
411 if(self.killtarget != "")
413 self.aiment = find(world, targetname, self.killtarget);
414 if(self.aiment == world)
416 error("Warp zone with nonexisting killtarget");
419 self.killtarget = string_null;
423 void WarpZonePosition_InitStep_FindTarget()
425 if(self.target == "")
427 error("Warp zone position with no target");
430 self.enemy = find(world, targetname, self.target);
431 if(self.enemy == world)
433 error("Warp zone position with nonexisting target");
436 if(self.enemy.aiment)
438 // already is positioned
439 error("Warp zone position targeting already oriented warpzone");
442 self.enemy.aiment = self;
445 void WarpZoneCamera_Think(void)
447 if(self.warpzone_save_origin != self.origin
448 || self.warpzone_save_angles != self.angles
449 || self.warpzone_save_eorigin != self.enemy.origin
450 || self.warpzone_save_eangles != self.enemy.angles)
452 WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
453 self.warpzone_save_origin = self.origin;
454 self.warpzone_save_angles = self.angles;
455 self.warpzone_save_eorigin = self.enemy.origin;
456 self.warpzone_save_eangles = self.enemy.angles;
458 self.nextthink = time;
461 void WarpZoneCamera_InitStep_FindTarget()
465 if(self.target == "")
467 error("Camera with no target");
471 for(e = world, i = 0; (e = find(e, targetname, self.target)); )
472 if(random() * ++i < 1)
474 if(self.enemy == world)
476 error("Camera with nonexisting target");
479 warpzone_cameras_exist = 1;
480 WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
481 self.SendFlags = 0xFFFFFF;
482 if(self.spawnflags & 1)
484 self.think = WarpZoneCamera_Think;
485 self.nextthink = time;
491 void WarpZone_InitStep_UpdateTransform()
493 vector org, ang, norm, point;
495 vector tri, a, b, c, p, q, n;
501 org = 0.5 * (self.mins + self.maxs);
503 norm = point = '0 0 0';
505 for(i_s = 0; ; ++i_s)
507 tex = getsurfacetexture(self, i_s);
509 break; // this is beyond the last one
510 if(tex == "textures/common/trigger" || tex == "trigger")
512 n_t = getsurfacenumtriangles(self, i_s);
513 for(i_t = 0; i_t < n_t; ++i_t)
515 tri = getsurfacetriangle(self, i_s, i_t);
516 a = getsurfacepoint(self, i_s, tri_x);
517 b = getsurfacepoint(self, i_s, tri_y);
518 c = getsurfacepoint(self, i_s, tri_z);
521 n = '1 0 0' * (q_y * p_z - q_z * p_y)
522 + '0 1 0' * (q_z * p_x - q_x * p_z)
523 + '0 0 1' * (q_x * p_y - q_y * p_x);
524 area = area + vlen(n);
526 point = point + vlen(n) * (a + b + c);
531 norm = norm * (1 / area);
532 point = point * (1 / (3 * area));
533 if(vlen(norm) < 0.99)
535 print("trigger_warpzone near ", vtos(self.aiment.origin), " is nonplanar. BEWARE.\n");
536 area = 0; // no autofixing in this case
538 norm = normalize(norm);
543 org = self.aiment.origin;
544 ang = self.aiment.angles;
547 org = org - ((org - point) * norm) * norm; // project to plane
549 if(norm * v_forward < 0)
551 print("Position target of trigger_warpzone near ", vtos(self.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
554 ang = vectoangles(norm, v_up); // keep rotation, but turn exactly against plane
556 if(norm * v_forward < 0.99)
557 print("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
558 if(vlen(org - self.aiment.origin) > 0.5)
559 print("trigger_warpzone near ", vtos(self.aiment.origin), " has been moved to match the plane (", vtos(self.aiment.origin), " -> ", vtos(org), ").\n");
565 ang = vectoangles(norm);
569 error("cannot infer origin/angles for this warpzone, please use a killtarget or a trigger_warpzone_position");
571 self.warpzone_origin = org;
572 self.warpzone_angles = ang;
575 void WarpZone_InitStep_ClearTarget()
578 self.enemy.enemy = world;
582 entity warpzone_first; .entity warpzone_next;
583 void WarpZone_InitStep_FindTarget()
591 // this way only one of the two ents needs to target
592 if(self.target != "")
594 self.enemy = self; // so the if(!e.enemy) check also skips self, saves one IF
597 for(e = world, i = 0; (e = find(e, targetname, self.target)); )
599 if(e.classname == self.classname) // possibly non-warpzones may use the same targetname!
600 if(random() * ++i < 1)
605 error("Warpzone with non-existing target");
613 void WarpZone_Think();
614 void WarpZone_InitStep_FinalizeTransform()
616 if(!self.enemy || self.enemy.enemy != self)
618 error("Invalid warp zone detected. Killed.");
622 warpzone_warpzones_exist = 1;
623 WarpZone_SetUp(self, self.warpzone_origin, self.warpzone_angles, self.enemy.warpzone_origin, self.enemy.warpzone_angles);
624 self.touch = WarpZone_Touch;
625 self.SendFlags = 0xFFFFFF;
626 if(self.spawnflags & 1)
628 self.think = WarpZone_Think;
629 self.nextthink = time;
635 float warpzone_initialized;
636 entity warpzone_first;
637 entity warpzone_position_first;
638 entity warpzone_camera_first;
639 .entity warpzone_next;
640 void spawnfunc_misc_warpzone_position(void)
642 // "target", "angles", "origin"
643 self.warpzone_next = warpzone_position_first;
644 warpzone_position_first = self;
646 void spawnfunc_trigger_warpzone_position(void)
648 spawnfunc_misc_warpzone_position();
650 void spawnfunc_trigger_warpzone(void)
652 // warp zone entities must have:
653 // "killtarget" pointing to a target_position with a direction arrow
654 // that points AWAY from the warp zone, and that is inside
655 // the warp zone trigger
656 // "target" pointing to an identical warp zone at another place in
657 // the map, with another killtarget to designate its
660 #ifndef WARPZONE_USE_FIXANGLE
661 // used when teleporting
662 precache_model("null");
666 self.scale = self.modelscale;
671 WarpZoneLib_ExactTrigger_Init();
675 setmodel(self, m); // no precision needed
677 setorigin(self, self.origin);
679 setsize(self, self.mins * self.scale, self.maxs * self.scale);
681 setsize(self, self.mins, self.maxs);
682 self.SendEntity = WarpZone_Send;
683 self.SendFlags = 0xFFFFFF;
684 BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
685 self.warpzone_next = warpzone_first;
686 warpzone_first = self;
688 void spawnfunc_func_camera(void)
691 self.scale = self.modelscale;
696 precache_model(self.model);
697 setmodel(self, self.model); // no precision needed
699 setorigin(self, self.origin);
701 setsize(self, self.mins * self.scale, self.maxs * self.scale);
703 setsize(self, self.mins, self.maxs);
705 self.solid = SOLID_BSP;
706 else if(self.solid < 0)
707 self.solid = SOLID_NOT;
708 self.SendEntity = WarpZone_Camera_Send;
709 self.SendFlags = 0xFFFFFF;
710 self.warpzone_next = warpzone_camera_first;
711 warpzone_camera_first = self;
713 void WarpZones_Reconnect()
717 for(self = warpzone_first; self; self = self.warpzone_next)
718 WarpZone_InitStep_ClearTarget();
719 for(self = warpzone_first; self; self = self.warpzone_next)
720 WarpZone_InitStep_FindTarget();
721 for(self = warpzone_camera_first; self; self = self.warpzone_next)
722 WarpZoneCamera_InitStep_FindTarget();
723 for(self = warpzone_first; self; self = self.warpzone_next)
724 WarpZone_InitStep_FinalizeTransform();
728 void WarpZone_Think()
730 if(self.warpzone_save_origin != self.origin
731 || self.warpzone_save_angles != self.angles
732 || self.warpzone_save_eorigin != self.enemy.origin
733 || self.warpzone_save_eangles != self.enemy.angles)
737 WarpZone_InitStep_UpdateTransform();
739 WarpZone_InitStep_UpdateTransform();
741 WarpZone_InitStep_FinalizeTransform();
743 WarpZone_InitStep_FinalizeTransform();
745 self.warpzone_save_origin = self.origin;
746 self.warpzone_save_angles = self.angles;
747 self.warpzone_save_eorigin = self.enemy.origin;
748 self.warpzone_save_eangles = self.enemy.angles;
750 self.nextthink = time;
753 void WarpZone_StartFrame()
756 if(warpzone_initialized == 0)
758 warpzone_initialized = 1;
760 for(self = warpzone_first; self; self = self.warpzone_next)
761 WarpZone_InitStep_FindOriginTarget();
762 for(self = warpzone_position_first; self; self = self.warpzone_next)
763 WarpZonePosition_InitStep_FindTarget();
764 for(self = warpzone_first; self; self = self.warpzone_next)
765 WarpZone_InitStep_UpdateTransform();
767 WarpZones_Reconnect();
770 if(warpzone_warpzones_exist)
772 entity oldself, oldother;
775 for(e = world; (e = nextent(e)); )
777 WarpZone_StoreProjectileData(e);
780 if(f == CLIENTTYPE_REAL)
782 if(e.solid != SOLID_NOT) // not spectating?
784 if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
786 self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
790 if(WarpZoneLib_ExactTrigger_Touch())
792 if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
793 WarpZone_Teleport(self, e, -1, 0); // NOT triggering targets by this!
795 if(f == CLIENTTYPE_NOTACLIENT)
797 for(; (e = nextent(e)); )
798 WarpZone_StoreProjectileData(e);
807 .float warpzone_reconnecting;
808 float visible_to_some_client(entity ent)
811 for(e = nextent(world); clienttype(e) != CLIENTTYPE_NOTACLIENT; e = nextent(e))
812 if(e.classname == "player" && clienttype(e) == CLIENTTYPE_REAL)
813 if(checkpvs(e.origin + e.view_ofs, ent))
817 void trigger_warpzone_reconnect_use()
821 // NOTE: this matches for target, not targetname, but of course
822 // targetname must be set too on the other entities
823 for(self = warpzone_first; self; self = self.warpzone_next)
824 self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && (visible_to_some_client(self) || visible_to_some_client(self.enemy))));
825 for(self = warpzone_camera_first; self; self = self.warpzone_next)
826 self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && visible_to_some_client(self)));
827 for(self = warpzone_first; self; self = self.warpzone_next)
828 if(self.warpzone_reconnecting)
829 WarpZone_InitStep_ClearTarget();
830 for(self = warpzone_first; self; self = self.warpzone_next)
831 if(self.warpzone_reconnecting)
832 WarpZone_InitStep_FindTarget();
833 for(self = warpzone_camera_first; self; self = self.warpzone_next)
834 if(self.warpzone_reconnecting)
835 WarpZoneCamera_InitStep_FindTarget();
836 for(self = warpzone_first; self; self = self.warpzone_next)
837 if(self.warpzone_reconnecting || self.enemy.warpzone_reconnecting)
838 WarpZone_InitStep_FinalizeTransform();
842 void spawnfunc_trigger_warpzone_reconnect()
844 self.use = trigger_warpzone_reconnect_use;
847 void spawnfunc_target_warpzone_reconnect()
849 spawnfunc_trigger_warpzone_reconnect(); // both names make sense here :(
852 void WarpZone_PlayerPhysics_FixVAngle(void)
854 #ifndef WARPZONE_DONT_FIX_VANGLE
855 if(clienttype(self) == CLIENTTYPE_REAL)
856 if(self.v_angle_z <= 360) // if not already adjusted
857 if(time - self.ping * 0.001 < self.warpzone_teleport_time)
859 self.v_angle = WarpZone_TransformVAngles(self.warpzone_teleport_zone, self.v_angle);
860 self.v_angle_z += 720; // mark as adjusted