r4321 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Sep 3 14:43:12 EDT 2008
Author: div0
Date: 2008-09-03 14:43:11 -0400 (Wed, 03 Sep 2008)
New Revision: 4321
Modified:
trunk/data/qcsrc/server/portals.qc
trunk/data/qcsrc/server/w_porto.qc
Log:
fix the porto
Modified: trunk/data/qcsrc/server/portals.qc
===================================================================
--- trunk/data/qcsrc/server/portals.qc 2008-09-03 17:00:03 UTC (rev 4320)
+++ trunk/data/qcsrc/server/portals.qc 2008-09-03 18:43:11 UTC (rev 4321)
@@ -136,6 +136,8 @@
o = portal.origin;
portal.mins = PL_MIN - '8 8 8';
portal.maxs = PL_MAX + '8 8 8';
+ fixedmakevectors(portal.mangle);
+ portal.origin += 16 * v_forward;
if(!move_out_of_solid(portal))
{
print("NO SAFE ORIGIN\n");
@@ -173,6 +175,15 @@
portal.solid = SOLID_NOT;
portal.touch = SUB_Null;
portal.effects = 0;
+ //portal.colormod = '1 1 1';
+ portal.nextthink = 0;
+}
+
+void Portal_MakeWaitingPortal(entity portal)
+{
+ portal.solid = SOLID_NOT;
+ portal.touch = SUB_Null;
+ portal.effects = EF_ADDITIVE;
portal.colormod = '1 1 1';
portal.nextthink = 0;
}
@@ -190,7 +201,7 @@
{
portal.solid = SOLID_NOT;
portal.touch = SUB_Null;
- portal.effects = EF_STARDUST;
+ portal.effects = EF_STARDUST | EF_BLUE;
portal.colormod = '0 0 1';
portal.nextthink = 0;
}
@@ -255,7 +266,7 @@
continue;
// if e would hit the portal in a frame...
// already teleport him
- tracebox(e.origin, e.mins, e.maxs, e.origin + e.velocity * 3 * frametime, MOVE_NORMAL, e);
+ tracebox(e.origin, e.mins, e.maxs, e.origin + e.velocity * 2 * frametime, MOVE_NORMAL, e);
if(trace_ent == self)
Portal_TeleportPlayer(self, e);
}
@@ -314,12 +325,10 @@
if(own.portal_out)
Portal_Remove(own.portal_out);
}
-float Portal_VerifyPortalAtTrace(vector ang)
+float Portal_VerifyPortal(vector org, vector ang)
{
- if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
- return 0;
fixedmakevectors(ang);
- if(!CheckWireframeBox(trace_endpos - 48 * v_right - 48 * v_up + 16 * v_forward, 96 * v_right, 96 * v_up, 16 * v_forward))
+ if(!CheckWireframeBox(org - 48 * v_right - 48 * v_up + 16 * v_forward, 96 * v_right, 96 * v_up, 16 * v_forward))
return 0;
return 1;
}
@@ -335,7 +344,7 @@
ang_x = -ang_x;
portal.angles = ang;
portal.think = Portal_Think;
- portal.nextthink = time;
+ portal.nextthink = 0;
portal.fade_time = time + 10;
portal.portal_activatetime = time + 0.1;
setmodel(portal, "models/portal.md3");
@@ -347,6 +356,7 @@
}
setsize(portal, '-48 -48 -48', '48 48 48');
+ Portal_MakeWaitingPortal(portal);
return portal;
}
@@ -355,6 +365,7 @@
{
entity portal;
vector ang;
+ vector org;
if(trace_ent.classname == "player")
{
@@ -363,7 +374,10 @@
trace_plane_normal = '0 0 1';
}
- if(!Portal_VerifyPortalAtTrace(dir))
+ org = trace_endpos;
+ ang = fixedvectoangles2(trace_plane_normal, dir);
+
+ if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || !Portal_VerifyPortal(org, ang))
{
// cannot create a portal here
// clear all to make sure
@@ -371,8 +385,7 @@
return 0;
}
- ang = fixedvectoangles2(trace_plane_normal, dir);
- portal = Portal_Spawn(own, trace_endpos, ang);
+ portal = Portal_Spawn(own, org, ang);
Portal_SetInPortal(own, portal);
return 1;
@@ -382,6 +395,7 @@
{
entity portal;
vector ang;
+ vector org;
if(trace_ent.classname == "player")
{
@@ -392,7 +406,10 @@
else
dir = -1 * dir; // invert the sense of the second portal
- if(!Portal_VerifyPortalAtTrace(dir))
+ org = trace_endpos;
+ ang = fixedvectoangles2(trace_plane_normal, dir);
+
+ if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || !Portal_VerifyPortal(org, ang))
{
// cannot create a portal here
// clear all to make sure
@@ -400,8 +417,7 @@
return 0;
}
- ang = fixedvectoangles2(trace_plane_normal, dir);
- portal = Portal_Spawn(own, trace_endpos, ang);
+ portal = Portal_Spawn(own, org, ang);
Portal_SetOutPortal(own, portal);
return 1;
Modified: trunk/data/qcsrc/server/w_porto.qc
===================================================================
--- trunk/data/qcsrc/server/w_porto.qc 2008-09-03 17:00:03 UTC (rev 4320)
+++ trunk/data/qcsrc/server/w_porto.qc 2008-09-03 18:43:11 UTC (rev 4321)
@@ -60,6 +60,7 @@
gren.flags = FL_PROJECTILE;
self.porto_grenade_id = gren.porto_grenade_id = time;
+ gren.playerid = self.playerid;
}
void spawnfunc_weapon_porto (void)
@@ -113,7 +114,8 @@
}
v_angle_save = self.v_angle;
if(self.porto_v_angle_held)
- self.v_angle = self.porto_v_angle;
+ makevectors(self.porto_v_angle); // override the previously set angles
+
if (self.BUTTON_ATCK)
if (!self.porto_grenade_id)
if (weapon_prepareattack(0, cvar("g_balance_porto_primary_refire")))
@@ -121,7 +123,6 @@
W_Porto_Attack();
weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_porto_primary_animtime"), w_ready);
}
- self.v_angle = v_angle_save;
}
else if (req == WR_PRECACHE)
{
More information about the nexuiz-commits
mailing list