}
}
+void CSQCModel_Fade_Apply()
+{
+ vector org;
+ float alph;
+ org = getpropertyvec(VF_ORIGIN);
+ if(!checkpvs(org, self)) // this makes sense as long as we don't support recursive warpzones
+ alph = 0;
+ else if(self.fade_start)
+ alph = bound(0, (self.fade_end - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) / (self.fade_end - self.fade_start), 1);
+ else
+ alph = 1;
+ //printf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs));
+ if(alph <= 0)
+ self.drawmask = 0;
+ else
+ self.drawmask = MASK_NORMAL;
+}
+
void CSQCPlayer_Precache()
{
precache_sound("misc/jetpack_fly.wav");
else
self.drawmask = MASK_NORMAL;
+ CSQCModel_Fade_Apply();
+
if(self.isplayermodel) // this checks if it's a player MODEL!
{
CSQCPlayer_ModelAppearance_Apply(self.entnum == player_localnum + 1);
CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255) \
CSQCMODEL_PROPERTY(8192, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) \
- CSQCMODEL_PROPERTY(16384, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask)
+ CSQCMODEL_PROPERTY(16384, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
+ CSQCMODEL_PROPERTY(32768, float, ReadCoord, WriteCoord, fade_start) \
+ CSQCMODEL_PROPERTY(32768, float, ReadCoord, WriteCoord, fade_end)
// TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
// add hook function calls here
returns true if handled
=============
*/
-float PlayerJump (void)
+bool PlayerJump (void)
{
if (PHYS_FROZEN(self))
return true; // no jumping in freezetag when frozen
int autocvar_g_sandbox_editor_free;
float autocvar_g_sandbox_editor_distance_spawn;
float autocvar_g_sandbox_editor_distance_edit;
+float autocvar_g_sandbox_object_fade_start;
+float autocvar_g_sandbox_object_fade_end;
float autocvar_g_sandbox_object_scale_min;
float autocvar_g_sandbox_object_scale_max;
float autocvar_g_sandbox_object_material_velocity_min;
}
}
-float PM_multijump_checkjump()
+bool PM_multijump_checkjump()
{
if(!PHYS_MULTIJUMP) { return false; }
- if (!IS_JUMP_HELD(self) && !IS_ONGROUND(self) && self.cvar_cl_multijump) // jump button pressed this frame and we are in midair
+#ifdef SVQC
+ bool client_multijump = self.cvar_cl_multijump;
+#elif defined(CSQC)
+ bool client_multijump = cvar("cl_multijump");
+#endif
+
+ if (!IS_JUMP_HELD(self) && !IS_ONGROUND(self) && client_multijump) // jump button pressed this frame and we are in midair
self.multijump_ready = true; // this is necessary to check that we released the jump button and pressed it again
else
self.multijump_ready = false;
// keep velocity_z unchanged!
}
if (PHYS_MULTIJUMP > 0)
+ {
+ #ifdef CSQC
+ print("Increasing!\n");
+ #endif
self.multijump_count += 1;
+ }
}
}
self.multijump_ready = false; // require releasing and pressing the jump button again for the next jump
self.realowner = world;
}
+ self.fade_start = autocvar_g_sandbox_object_fade_start;
+ self.fade_end = autocvar_g_sandbox_object_fade_end;
+
self.nextthink = time;
CSQCMODEL_AUTOUPDATE();