X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fportals.qc;h=75dae14bf5f28d666e9beb91e820e912389a1a54;hb=64b6c7420b3e1c307f408a9f17d9c765a268621a;hp=461f475c7818787f113386378b1a4e09159fa46d;hpb=44effb3a66f8b44d05106ff361ef5fc126fef03b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 461f475c78..75dae14bf5 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -7,6 +7,7 @@ .vector portal_safe_origin; .float portal_wants_to_vanish; .float portal_activatetime; +.float savemodelindex; float PlayerEdgeDistance(entity p, vector v) { @@ -153,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) { @@ -479,7 +483,7 @@ float Portal_Customize() other = other.enemy; if(other == self.aiment) { - self.modelindex = self.modelindex_lod0; + self.modelindex = self.savemodelindex; } else if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(self.aiment)) { @@ -487,7 +491,7 @@ float Portal_Customize() } else { - self.modelindex = self.modelindex_lod0; + self.modelindex = self.savemodelindex; } return TRUE; } @@ -617,7 +621,7 @@ entity Portal_Spawn(entity own, vector org, vector ang) portal.fade_time = time + autocvar_g_balance_portal_lifetime; portal.health = autocvar_g_balance_portal_health; setmodel(portal, "models/portal.md3"); - portal.modelindex_lod0 = portal.modelindex; + portal.savemodelindex = portal.modelindex; portal.customizeentityforclient = Portal_Customize; if(!Portal_FindSafeOrigin(portal)) @@ -644,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); @@ -668,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);