+#include "movetypes.qh"
+#include "_all.qh"
+
+#include "t_items.qh"
+
+#include "../common/stats.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/common.qh"
+
+
const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
#define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
float _Movetype_CheckWater(entity ent) // SV_CheckWater
{
- float supercontents;
- float nativecontents;
- vector point;
-
- point = ent.move_origin;
- point_z += (ent.mins.z + 1);
+ vector point = ent.move_origin;
+ point.z += (ent.mins.z + 1);
- nativecontents = pointcontents(point);
+ int nativecontents = pointcontents(point);
if(ent.move_watertype)
if(ent.move_watertype != nativecontents)
ent.move_waterlevel = 0;
ent.move_watertype = CONTENT_EMPTY;
- supercontents = Mod_Q1BSP_SuperContentsFromNativeContents(nativecontents);
+ int supercontents = Mod_Q1BSP_SuperContentsFromNativeContents(nativecontents);
if(supercontents & DPCONTENTS_LIQUIDSMASK)
{
ent.move_watertype = nativecontents;
ent.move_waterlevel = 1;
- point_y = (ent.origin.y + ((ent.mins.z + ent.maxs.y) * 0.5));
+ point.y = (ent.origin.y + ((ent.mins.z + ent.maxs.y) * 0.5));
if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(point)) & DPCONTENTS_LIQUIDSMASK)
{
ent.move_waterlevel = 2;
- point_y = ent.origin.y + ent.view_ofs.y;
+ point.y = ent.origin.y + ent.view_ofs.y;
if(Mod_Q1BSP_SuperContentsFromNativeContents(pointcontents(point)) & DPCONTENTS_LIQUIDSMASK)
ent.move_waterlevel = 3;
}
void _Movetype_CheckWaterTransition(entity ent) // SV_CheckWaterTransition
{
float contents = pointcontents(ent.move_origin);
-
+
if(!ent.move_watertype)
{
// just spawned here
float _Movetype_TestEntityPosition(vector ofs) // SV_TestEntityPosition
{
vector org;
- float cont;
org = self.move_origin + ofs;
- cont = self.dphitcontentsmask;
+ int cont = self.dphitcontentsmask;
self.dphitcontentsmask = DPCONTENTS_SOLID;
tracebox(self.move_origin, self.mins, self.maxs, self.move_origin, MOVE_NOMONSTERS, self);
self.dphitcontentsmask = cont;
{
vel = vel - ((vel * norm) * norm) * f;
- if(vel.x > -0.1 && vel.x < 0.1) vel_x = 0;
- if(vel.y > -0.1 && vel.y < 0.1) vel_y = 0;
- if(vel.z > -0.1 && vel.z < 0.1) vel_z = 0;
+ if(vel.x > -0.1 && vel.x < 0.1) vel.x = 0;
+ if(vel.y > -0.1 && vel.y < 0.1) vel.y = 0;
+ if(vel.z > -0.1 && vel.z < 0.1) vel.z = 0;
return vel;
}