+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+ #include "../dpdefs/progsdefs.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "../warpzonelib/anglestransform.qh"
+ #include "../warpzonelib/util_server.qh"
+ #include "../common/constants.qh"
+ #include "../common/util.qh"
+ #include "../common/weapons/weapons.qh"
+ #include "autocvars.qh"
+ #include "defs.qh"
+ #include "../common/notifications.qh"
+ #include "../common/deathtypes.qh"
+ #include "mutators/mutators_include.qh"
+ #include "../csqcmodellib/sv_model.qh"
+ #include "portals.qh"
+ #include "g_hook.qh"
+#endif
+
#define PORTALS_ARE_NOT_SOLID
-#define SAFENUDGE '1 1 1'
-#define SAFERNUDGE '8 8 8'
+const vector SAFENUDGE = '1 1 1';
+const vector SAFERNUDGE = '8 8 8';
.vector portal_transform;
.vector portal_safe_origin;
{
vector vbest;
- if(v_x < 0) vbest_x = p.mins_x; else vbest_x = p.maxs_x;
- if(v_y < 0) vbest_y = p.mins_y; else vbest_y = p.maxs_y;
- if(v_z < 0) vbest_z = p.mins_z; else vbest_z = p.maxs_z;
+ if(v.x < 0) vbest_x = p.mins.x; else vbest_x = p.maxs.x;
+ if(v.y < 0) vbest_y = p.mins.y; else vbest_y = p.maxs.y;
+ if(v.z < 0) vbest_z = p.mins.z; else vbest_z = p.maxs.z;
return vbest * v;
}
// PLAYERS use different math
#ifndef POSITIVE_PITCH_IS_DOWN
- ang_x = -ang_x;
+ ang_x = -ang.x;
#endif
//print("reference: ", vtos(AnglesTransform_ApplyToVAngles(transform, ang)), "\n");
fixedmakevectors(ang);
old_forward = v_forward;
old_up = v_up;
- fixedmakevectors(ang_y * '0 1 0');
+ fixedmakevectors(ang.y * '0 1 0');
old_yawforward = v_forward;
// their aiming directions are portalled...
//
// new_up could now point forward OR backward... which direction to choose?
- if(new_forward_z > 0.7 || new_forward_z < -0.7) // far up; in this case, the "up" vector points backwards
+ if(new_forward.z > 0.7 || new_forward.z < -0.7) // far up; in this case, the "up" vector points backwards
{
// new_yawforward and new_yawup define the new aiming half-circle
// we "just" need to find out whether new_up or -new_up is in that half circle
}
#ifndef POSITIVE_PITCH_IS_DOWN
- ang_x = -ang_x;
+ ang_x = -ang.x;
#endif
- ang_z = vangle_z;
+ ang_z = vangle.z;
return ang;
}
vector v;
dist = (eorg - porg) * pnorm;
- dist += min(emins_x * pnorm_x, emaxs_x * pnorm_x);
- dist += min(emins_y * pnorm_y, emaxs_y * pnorm_y);
- dist += min(emins_z * pnorm_z, emaxs_z * pnorm_z);
+ dist += min(emins.x * pnorm.x, emaxs.x * pnorm.x);
+ dist += min(emins.y * pnorm.y, emaxs.y * pnorm.y);
+ dist += min(emins.z * pnorm.z, emaxs.z * pnorm.z);
if(dist < -1) // other side?
return 0;
#ifdef PORTALS_ARE_NOT_SOLID
return; // cannot go through someone else's portal
fixedmakevectors(self.mangle);
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))
+ if(!Portal_WillHitPlane(other.origin, other.mins, other.maxs, other.velocity + g, self.origin, v_forward, self.maxs.x))
return;
/*
void Portal_Think_TryTeleportPlayer(entity e, vector g)
{
- if(!Portal_WillHitPlane(e.origin, e.mins, e.maxs, e.velocity + g, self.origin, v_forward, self.maxs_x))
+ if(!Portal_WillHitPlane(e.origin, e.mins, e.maxs, e.velocity + g, self.origin, v_forward, self.maxs.x))
return;
// if e would hit the portal in a frame...
{
self.modelindex = self.savemodelindex;
}
- return TRUE;
+ return true;
}
// cleanup:
setorigin(portal, org);
portal.mangle = ang;
portal.angles = ang;
- portal.angles_x = -portal.angles_x; // is a bmodel
+ portal.angles_x = -portal.angles.x; // is a bmodel
portal.think = Portal_Think;
portal.nextthink = 0;
portal.portal_activatetime = time + 0.1;