X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Fteleporters.qc;h=1f0c00e5e8e2d36211cffe95d5bd1b26390b7771;hb=d4e9ae30b350c9f471dcb72929e976735c818919;hp=5e91d7607314525f77b4ad4be7b484241e4037cd;hpb=117fa45380851579df9e6c465a207d733f6ca748;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 5e91d7607..1f0c00e5e 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -3,9 +3,9 @@ #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) - #include "../../warpzonelib/common.qh" - #include "../../warpzonelib/util_server.qh" - #include "../../warpzonelib/server.qh" + #include "../../lib/warpzone/common.qh" + #include "../../lib/warpzone/util_server.qh" + #include "../../lib/warpzone/server.qh" #include "../constants.qh" #include "../triggers/subs.qh" #include "../util.qh" @@ -13,9 +13,9 @@ #include "../../server/autocvars.qh" #include "../../server/constants.qh" #include "../../server/defs.qh" - #include "../deathtypes.qh" - #include "../../server/tturrets/include/turrets_early.qh" - #include "../../server/vehicles/vehicles_def.qh" + #include "../deathtypes/all.qh" + #include "../turrets/sv_turrets.qh" + #include "../vehicles/all.qh" #include "../mapinfo.qh" #include "../../server/anticheat.qh" #endif @@ -48,11 +48,11 @@ void tdeath(entity player, entity teleporter, entity telefragger, vector telefra if(IS_PLAYER(head)) if(head.health >= 1) ++tdeath_hit; - Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0'); + Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, head.origin, '0 0 0'); } } else // dead bodies and monsters gib themselves instead of telefragging - Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG, telefragger.origin, '0 0 0'); + Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, telefragger.origin, '0 0 0'); } } @@ -62,7 +62,7 @@ void spawn_tdeath(vector v0, entity e, vector v) } void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags) -{ +{SELFPARAM(); entity telefragger; vector from; @@ -78,11 +78,11 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps { if(tflags & TELEPORT_FLAG_SOUND) - sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM); + sound (player, CH_TRIGGER, SND_TELEPORT, VOL_BASE, ATTEN_NORM); if(tflags & TELEPORT_FLAG_PARTICLES) { - pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1); - pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, to + v_forward * 32, '0 0 0', 1); } self.pushltime = time + 0.2; } @@ -177,8 +177,8 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) return e; } -void teleport_findtarget (void) -{ +void teleport_findtarget () +{SELFPARAM(); entity e; float n; @@ -189,7 +189,7 @@ void teleport_findtarget (void) if(e.movetype == MOVETYPE_NONE) waypoint_spawnforteleporter(self, e.origin, 0); if(e.classname != "info_teleport_destination") - print("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n"); + LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n"); } if(n == 0) @@ -223,22 +223,19 @@ entity Teleport_Find(vector mi, vector ma) } void WarpZone_PostTeleportPlayer_Callback(entity pl) -{ +{SELFPARAM(); makevectors(pl.angles); Reset_ArcBeam(pl, v_forward); UpdateCSQCProjectileAfterTeleport(pl); { - entity oldself = self; - self = pl; - anticheat_fixangle(); - self = oldself; + WITH(entity, self, pl, anticheat_fixangle()); } // "disown" projectiles after teleport if(pl.owner) if(pl.owner == pl.realowner) { if(!(pl.flags & FL_PROJECTILE)) - print("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n"); + LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n"); pl.owner = world; } if(IS_PLAYER(pl))