]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/portals.qc
Merge remote-tracking branch 'origin/master' into fruitiex/animations
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / portals.qc
index 4020d5d53f3b9e1a8bbbe24942e18686d6ed960a..461f475c7818787f113386378b1a4e09159fa46d 100644 (file)
@@ -179,9 +179,9 @@ float Portal_TeleportPlayer(entity teleporter, entity player)
 
        // reset fade counter
        teleporter.portal_wants_to_vanish = 0;
-       teleporter.fade_time = time + cvar("g_balance_portal_lifetime");
-       teleporter.health = cvar("g_balance_portal_health");
-       teleporter.enemy.health = cvar("g_balance_portal_health");
+       teleporter.fade_time = time + autocvar_g_balance_portal_lifetime;
+       teleporter.health = autocvar_g_balance_portal_health;
+       teleporter.enemy.health = autocvar_g_balance_portal_health;
 
        return 1;
 }
@@ -281,7 +281,7 @@ void Portal_Touch()
                        if(IS_INDEPENDENT_PLAYER(other.aiment) || IS_INDEPENDENT_PLAYER(self.aiment))
                                return; // cannot go through someone else's portal
        fixedmakevectors(self.mangle);
-       g = frametime * '0 0 -1' * cvar("sv_gravity");
+       g = frametime * '0 0 -1' * autocvar_sv_gravity;
        if(!Portal_WillHitPlane(other.origin, other.mins, other.maxs, other.velocity + g, self.origin, v_forward, self.maxs_x))
                return;
 
@@ -355,13 +355,13 @@ void Portal_Disconnect(entity teleporter, entity destination)
 
 void Portal_Connect(entity teleporter, entity destination)
 {
-       teleporter.portal_transform = AnglesTransform_Divide(AnglesTransform_TurnDirectionFR(destination.mangle), teleporter.mangle);
+       teleporter.portal_transform = AnglesTransform_RightDivide(AnglesTransform_TurnDirectionFR(destination.mangle), teleporter.mangle);
 
        teleporter.enemy = destination;
        destination.enemy = teleporter;
        Portal_MakeInPortal(teleporter);
        Portal_MakeOutPortal(destination);
-       teleporter.fade_time = time + cvar("g_balance_portal_lifetime");
+       teleporter.fade_time = time + autocvar_g_balance_portal_lifetime;
        destination.fade_time = teleporter.fade_time;
        teleporter.portal_wants_to_vanish = 0;
        destination.portal_wants_to_vanish = 0;
@@ -394,14 +394,14 @@ void Portal_Remove(entity portal, float killed)
        if(killed)
        {
                fixedmakevectors(portal.mangle);
-               sound(portal, CHAN_PROJECTILE, "porto/explode.wav", VOL_BASE, ATTN_NORM);
+               sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTN_NORM);
                pointparticles(particleeffectnum("rocket_explode"), portal.origin + v_forward * 16, v_forward * 1024, 4);
                remove(portal);
        }
        else
        {
                Portal_MakeBrokenPortal(portal);
-               sound(portal, CHAN_PROJECTILE, "porto/expire.wav", VOL_BASE, ATTN_NORM);
+               sound(portal, CH_SHOTS, "porto/expire.wav", VOL_BASE, ATTN_NORM);
                SUB_SetFade(portal, time, 0.5);
        }
 }
@@ -447,7 +447,7 @@ void Portal_Think()
        self.solid = SOLID_BBOX;
        self.aiment = world;
 
-       g = frametime * '0 0 -1' * cvar("sv_gravity");
+       g = frametime * '0 0 -1' * autocvar_sv_gravity;
 
        fixedmakevectors(self.mangle);
 
@@ -614,8 +614,8 @@ entity Portal_Spawn(entity own, vector org, vector ang)
        portal.portal_activatetime = time + 0.1;
        portal.takedamage = DAMAGE_AIM;
        portal.event_damage = Portal_Damage;
-       portal.fade_time = time + cvar("g_balance_portal_lifetime");
-       portal.health = cvar("g_balance_portal_health");
+       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.customizeentityforclient = Portal_Customize;