case ENT_CLIENT_TUBANOTE: Ent_TubaNote(bIsNewEntity); break;
case ENT_CLIENT_WARPZONE: WarpZone_Read(bIsNewEntity); break;
case ENT_CLIENT_WARPZONE_CAMERA: WarpZone_Camera_Read(bIsNewEntity); break;
+ case ENT_CLIENT_WARPZONE_TELEPORTED: WarpZone_Teleported_Read(bIsNewEntity); break;
case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break;
const float ENT_CLIENT_LGBEAM = 28;
const float ENT_CLIENT_GAUNTLET = 29;
const float ENT_CLIENT_ACCURACY = 30;
+const float ENT_CLIENT_WARPZONE_TELEPORTED = 31;
const float ENT_CLIENT_TURRET = 40;
self.drawmask = MASK_NORMAL;
}
+void WarpZone_Teleported_Read(float isnew)
+{
+ vector v;
+ self.classname = "warpzone_teleported";
+ v_x = ReadCoord();
+ v_y = ReadCoord();
+ v_z = ReadCoord();
+ if(!isnew)
+ return;
+ self.warpzone_transform = v;
+ R_SetView3fv(VF_CL_VIEWANGLES, WarpZone_TransformVAngles(self, R_SetView3fv(VF_CL_VIEWANGLES)));
+}
+
float warpzone_fixingview;
float warpzone_fixingview_drawexteriormodel;
//float warpzone_fixingview_sidespeed;
void WarpZone_Read(float bIsNewEntity);
void WarpZone_Camera_Read(float bIsNewEntity);
+void WarpZone_Teleported_Read(float bIsNewEntity);
vector warpzone_fixview_origin;
vector warpzone_fixview_angles;
WarpZone_PostTeleportPlayer_Callback(player);
}
+float WarpZone_Teleported_Send(entity to, float sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
+ WriteCoord(MSG_ENTITY, self.angles_x);
+ WriteCoord(MSG_ENTITY, self.angles_y);
+ WriteCoord(MSG_ENTITY, self.angles_z);
+ return TRUE;
+}
+
float WarpZone_Teleport(entity player)
{
vector o0, a0, v0, o1, a1, v1;
WarpZone_StoreProjectileData(player);
player.warpzone_teleport_time = time;
player.warpzone_teleport_zone = self;
+#ifndef WARPZONE_USE_FIXANGLE
+ // instead of fixangle, send the transform to the client for smoother operation
+ player.fixangle = FALSE;
+
+ entity ts = spawn();
+ setmodel(ts, "null");
+ ts.SendEntity = WarpZone_Teleported_Send;
+ ts.SendFlags = 0xFFFFFF;
+ ts.drawonlytoclient = player;
+ ts.think = SUB_Remove;
+ ts.nextthink = time + 1;
+ ts.owner = player;
+ ts.enemy = self;
+ ts.effects = EF_NODEPTHTEST;
+ ts.classname = "warpzone_teleported";
+ ts.angles = self.warpzone_transform;
+#endif
return 1;
}