-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qc"
- #include "../dpdefs/dpextensions.qc"
- #include "sys-post.qh"
- #include "../warpzonelib/server.qh"
- #include "../common/constants.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "../common/net_notice.qh"
- #include "../common/monsters/monsters.qh"
- #include "../common/monsters/sv_monsters.qh"
- #include "../common/weapons/weapons.qh"
- #include "t_items.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
- #include "vehicles/vehicles_def.qh"
- #include "campaign.qh"
- #include "../common/mapinfo.qh"
- #include "command/common.qh"
- #include "command/vote.qh"
- #include "../csqcmodellib/sv_model.qh"
- #include "anticheat.qh"
- #include "cheats.qh"
- #include "../common/playerstats.qh"
- #include "portals.qh"
- #include "g_hook.qh"
- #include "scores.qh"
- #include "spawnpoints.qh"
- #include "ipban.qh"
- #include "race.qh"
- #include "antilag.qh"
- #include "playerdemo.qh"
-#endif
+#include "cl_client.qh"
+
+#include "waypointsprites.qh"
+
+#include "anticheat.qh"
+#include "cl_impulse.qh"
+#include "cl_player.qh"
+#include "ent_cs.qh"
+#include "ipban.qh"
+#include "miscfunctions.qh"
+#include "portals.qh"
+#include "teamplay.qh"
+#include "playerdemo.qh"
+#include "spawnpoints.qh"
+#include "g_damage.qh"
+#include "g_hook.qh"
+#include "command/common.qh"
+#include "cheats.qh"
+#include "g_world.qh"
+#include "race.qh"
+#include "antilag.qh"
+#include "campaign.qh"
+#include "command/common.qh"
+
+#include "bot/bot.qh"
+#include "bot/navigation.qh"
+
+#include "vehicles/vehicle.qh"
+
+#include "weapons/hitplot.qh"
+#include "weapons/weaponsystem.qh"
+
+#include "../common/net_notice.qh"
+#include "../common/physics.qh"
+
+#include "../common/triggers/subs.qh"
+#include "../common/triggers/triggers.qh"
+#include "../common/triggers/trigger/secret.qh"
+
+#include "../common/items/inventory.qh"
+
+#include "../common/monsters/sv_monsters.qh"
+
+#include "../warpzonelib/server.qh"
+
void send_CSQC_teamnagger() {
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
}
-float ClientData_Send(entity to, float sf)
+float ClientData_Send(entity to, int sf)
{
if(to != self.owner)
{
if(IS_REAL_CLIENT(self))
{
+ Item_ItemsTime_SetTimesForPlayer(self);
msg_entity = self;
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, self);
defaultskin = 0;
chmdl = false;
- if(autocvar_sv_defaultcharacter == 1)
+ if(autocvar_sv_defaultcharacter)
{
if(teamplay)
{
if(IS_PLAYER(self))
{
entity spot, oldself;
- float j;
accuracy_resend(self);
else
self.superweapons_finished = 0;
+ if(!warmup_stage)
+ Item_ItemsTime_ResetTimesForPlayer(self);
+
if(g_weaponarena_random) // WEAPONTODO: more stuff that should be in a mutator. also: rename those cvars
{
if(g_weaponarena_random_with_blaster)
self.respawn_flags = 0;
self.respawn_time = 0;
self.stat_respawn_time = 0;
- self.scale = 0;
+ self.scale = autocvar_sv_player_scale;
self.fade_time = 0;
self.pain_frame = 0;
self.pain_finished = 0;
self.bot_attack = true;
self.monster_attack = true;
-
+
self.spider_slowness = 0;
self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0;
target_voicescript_clear(self);
// reset fields the weapons may use
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+ for (int j = WEP_FIRST; j <= WEP_LAST; ++j)
{
WEP_ACTION(j, WR_RESETPLAYER);
// all weapons must be fully loaded when we spawn
- entity e;
- e = get_weaponinfo(j);
- if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
+ entity e = get_weaponinfo(j);
+ if (e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
self.(weapon_load[j]) = e.reloading_ammo;
}
.float ebouncefactor, ebouncestop; // electro's values
// TODO do we need all these fields, or should we stop autodetecting runtime
// changes and just have a console command to update this?
-float ClientInit_SendEntity(entity to, float sf)
+float ClientInit_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_INIT);
WriteByte(MSG_ENTITY, g_nexball_meter_period * 32);
float n, i;
string s;
- // NOTE: we do NOT check crypto_keyfp here, an unsigned ID is fine too for this
+ // NOTE: we do NOT check crypto_idfp_signed here, an unsigned ID is fine too for this
if (!p.crypto_idfp)
return 0;
return 0;
}
+#ifdef DP_EXT_PRECONNECT
+/*
+=============
+ClientPreConnect
+
+Called once (not at each match start) when a client begins a connection to the server
+=============
+*/
+void ClientPreConnect (void)
+{
+ if(autocvar_sv_eventlog)
+ {
+ GameLogEcho(sprintf(":connect:%d:%d:%s",
+ self.playerid,
+ num_for_edict(self),
+ ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot")
+ ));
+ }
+}
+#endif
+
/*
=============
ClientConnect
PlayerScore_Attach(self);
ClientData_Attach();
accuracy_init(self);
+ Inventory_new(self);
bot_clientconnect();
if(IS_REAL_CLIENT(self))
sv_notice_join();
+ for (entity e = world; (e = findfloat(e, init_for_player_needed, 1)); ) {
+ entity oldself = self;
+ self = e;
+ e.init_for_player(oldself);
+ self = oldself;
+ }
+
MUTATOR_CALLHOOK(ClientConnect);
}
/*
bot_relinkplayerlist();
accuracy_free(self);
+ Inventory_delete(self);
ClientData_Detach();
PlayerScore_Detach(self);
void GetPressedKeys(void) {
MUTATOR_CALLHOOK(GetPressedKeys);
- if (self.movement.x > 0) // get if movement keys are pressed
- { // forward key pressed
- self.pressedkeys |= KEY_FORWARD;
- self.pressedkeys &= ~KEY_BACKWARD;
- }
- else if (self.movement.x < 0)
- { // backward key pressed
- self.pressedkeys |= KEY_BACKWARD;
- self.pressedkeys &= ~KEY_FORWARD;
- }
- else
- { // no x input
- self.pressedkeys &= ~KEY_FORWARD;
- self.pressedkeys &= ~KEY_BACKWARD;
- }
-
- if (self.movement.y > 0)
- { // right key pressed
- self.pressedkeys |= KEY_RIGHT;
- self.pressedkeys &= ~KEY_LEFT;
- }
- else if (self.movement.y < 0)
- { // left key pressed
- self.pressedkeys |= KEY_LEFT;
- self.pressedkeys &= ~KEY_RIGHT;
- }
- else
- { // no y input
- self.pressedkeys &= ~KEY_RIGHT;
- self.pressedkeys &= ~KEY_LEFT;
- }
-
- if (self.BUTTON_JUMP) // get if jump and crouch keys are pressed
- self.pressedkeys |= KEY_JUMP;
- else
- self.pressedkeys &= ~KEY_JUMP;
- if (self.BUTTON_CROUCH)
- self.pressedkeys |= KEY_CROUCH;
- else
- self.pressedkeys &= ~KEY_CROUCH;
-
- if (self.BUTTON_ATCK)
- self.pressedkeys |= KEY_ATCK;
- else
- self.pressedkeys &= ~KEY_ATCK;
- if (self.BUTTON_ATCK2)
- self.pressedkeys |= KEY_ATCK2;
- else
- self.pressedkeys &= ~KEY_ATCK2;
+ #define X(var,bit,flag) (flag ? var |= bit : var &= ~bit)
+ X(self.pressedkeys, KEY_FORWARD, self.movement_x > 0);
+ X(self.pressedkeys, KEY_BACKWARD, self.movement_x < 0);
+ X(self.pressedkeys, KEY_RIGHT, self.movement_y > 0);
+ X(self.pressedkeys, KEY_LEFT, self.movement_y < 0);
+
+ X(self.pressedkeys, KEY_JUMP, PHYS_INPUT_BUTTON_JUMP(self));
+ X(self.pressedkeys, KEY_CROUCH, PHYS_INPUT_BUTTON_CROUCH(self));
+ X(self.pressedkeys, KEY_ATCK, PHYS_INPUT_BUTTON_ATCK(self));
+ X(self.pressedkeys, KEY_ATCK2, PHYS_INPUT_BUTTON_ATCK2(self));
+ #undef X
}
/*
*/
.float usekeypressed;
void() nexball_setstatus;
-.float items_added;
+.int items_added;
void PlayerPreThink (void)
{
WarpZone_PlayerPhysics_FixVAngle();
self.stat_allow_oldvortexbeam = autocvar_g_allow_oldvortexbeam;
self.stat_leadlimit = autocvar_leadlimit;
+ self.weaponsinmap = weaponsInMap;
+
if(frametime)
{
// physics frames: update anticheat stuff
{
self.revive_progress = bound(0, self.revive_progress - frametime * self.revive_speed, 1);
self.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * self.revive_progress );
-
+
if(self.health < 1)
{
if(self.vehicle)
do_crouch = 0;
// WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
- // It cannot be predicted by the engine!
+ // It cannot be predicted by the engine!
if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
do_crouch = 0;
if (!self.crouch)
{
self.crouch = true;
- self.view_ofs = PL_CROUCH_VIEW_OFS;
- setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX);
+ self.view_ofs = self.stat_pl_crouch_view_ofs;
+ setsize (self, self.stat_pl_crouch_min, self.stat_pl_crouch_max);
// setanim(self, self.anim_duck, false, true, true); // this anim is BROKEN anyway
}
}
{
if (self.crouch)
{
- tracebox(self.origin, PL_MIN, PL_MAX, self.origin, false, self);
+ tracebox(self.origin, self.stat_pl_min, self.stat_pl_max, self.origin, false, self);
if (!trace_startsolid)
{
self.crouch = false;
- self.view_ofs = PL_VIEW_OFS;
- setsize (self, PL_MIN, PL_MAX);
+ self.view_ofs = self.stat_pl_view_ofs;
+ setsize (self, self.stat_pl_min, self.stat_pl_max);
}
}
}
player_regen();
- // WEAPONTODO: Add a weapon request for this
+ // WEAPONTODO: Add a weapon request for this
// rot vortex charge to the charge limit
if(WEP_CVAR(vortex, charge_rot_rate) && self.vortex_charge > WEP_CVAR(vortex, charge_limit) && self.vortex_charge_rottime < time)
self.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), self.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);