X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fportals.qc;h=f0b9c5b21861a8095913ca6fc3066a53590c4411;hp=bf50c9d3cada867c7d4d2034244a5a75a0d8caa4;hb=fc0e4c6f26156858a71e0ec62eb974fa11eec2f9;hpb=74511aee30c0470380c6f99a472028465c3caf80 diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index bf50c9d3c..f0b9c5b21 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -154,8 +154,11 @@ float Portal_TeleportPlayer(entity teleporter, entity player) // factor -1 allows chaining portals, but may be weird player.right_vector = -1 * AnglesTransform_Apply(transform, player.right_vector); - if(player.flagcarried) - DropFlag(player.flagcarried, player, world); + entity oldself = self; + self = player; + MUTATOR_CALLHOOK(PortalTeleport); + player = self; + self = oldself; if not(teleporter.enemy) { @@ -169,7 +172,7 @@ float Portal_TeleportPlayer(entity teleporter, entity player) { // telefrag within 1 second of portal creation = amazing if(time < teleporter.teleport_time + 1) - AnnounceTo(player, "amazing"); + Send_Notification(NOTIF_ONE, player, MSG_ANNCE, ANNCE_ACHIEVEMENT_AMAZING); } if not(teleporter.enemy) @@ -306,8 +309,8 @@ void Portal_MakeBrokenPortal(entity portal) { portal.skin = 2; portal.solid = SOLID_NOT; - portal.touch = SUB_Null; - portal.think = SUB_Null; + portal.touch = func_null; + portal.think = func_null; portal.effects = 0; portal.nextthink = 0; portal.takedamage = DAMAGE_NO; @@ -317,8 +320,8 @@ void Portal_MakeWaitingPortal(entity portal) { portal.skin = 2; portal.solid = SOLID_NOT; - portal.touch = SUB_Null; - portal.think = SUB_Null; + portal.touch = func_null; + portal.think = func_null; portal.effects = EF_ADDITIVE; portal.nextthink = 0; portal.takedamage = DAMAGE_YES; @@ -339,8 +342,8 @@ void Portal_MakeOutPortal(entity portal) { portal.skin = 1; portal.solid = SOLID_NOT; - portal.touch = SUB_Null; - portal.think = SUB_Null; + portal.touch = func_null; + portal.think = func_null; portal.effects = EF_STARDUST | EF_BLUE; portal.nextthink = 0; portal.takedamage = DAMAGE_YES; @@ -645,11 +648,7 @@ float Portal_SpawnInPortalAtTrace(entity own, vector dir, float portal_id_val) portal = Portal_Spawn(own, org, ang); if(!portal) - { - // if(!own.portal_out || own.portal_out.portal_id == portal_id_val) - Portal_ClearAll_PortalsOnly(own); return 0; - } portal.portal_id = portal_id_val; Portal_SetInPortal(own, portal); @@ -669,11 +668,7 @@ float Portal_SpawnOutPortalAtTrace(entity own, vector dir, float portal_id_val) portal = Portal_Spawn(own, org, ang); if(!portal) - { - // if(!own.portal_in || own.portal_in.portal_id == portal_id_val) - Portal_ClearAll_PortalsOnly(own); return 0; - } portal.portal_id = portal_id_val; Portal_SetOutPortal(own, portal);