if(this.bot_attack)
IL_REMOVE(g_bot_targets, this);
this.bot_attack = false;
+ if(this.monster_attack)
+ IL_REMOVE(g_monster_targets, this);
+ this.monster_attack = false;
STAT(HUD, this) = HUD_NORMAL;
TRANSMUTE(Observer, this);
this.iscreature = false;
this.strength_finished = 0;
this.invincible_finished = 0;
this.superweapons_finished = 0;
+ this.dphitcontentsmask = 0;
this.pushltime = 0;
this.istypefrag = 0;
setthink(this, func_null);
stuffcmd(e, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));
stuffcmd(e, sprintf("\ncl_jumpspeedcap_max \"%s\"\n", autocvar_sv_jumpspeedcap_max));
+ stuffcmd(e, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
+
MUTATOR_CALLHOOK(FixClientCvars, e);
}
JoinBestTeam(this, false); // if the team number is valid, keep it
this.playerid = playerid_save;
- if (autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0) {
- TRANSMUTE(Observer, this);
- } else {
- if (!teamplay || autocvar_g_balance_teams) {
- TRANSMUTE(Player, this);
- campaign_bots_may_start = true;
- } else {
- TRANSMUTE(Observer, this); // do it anyway
- }
- }
+ TRANSMUTE(Observer, this);
PlayerStats_GameReport_AddEvent(sprintf("kills-%d", this.playerid));
}
.int items_added;
+.string shootfromfixedorigin;
bool PlayerThink(entity this)
{
if (game_stopped || intermission_running) {
return false;
}
- bool have_hook = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- {
- .entity weaponentity = weaponentities[slot];
- if(this.(weaponentity).hook.state)
- {
- have_hook = true;
- break;
- }
- }
- bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
- if (have_hook) {
- do_crouch = false;
- } else if (this.waterlevel >= WATERLEVEL_SWIMMING) {
- do_crouch = false;
- } else if (this.vehicle) {
- do_crouch = false;
- } else if (STAT(FROZEN, this)) {
- do_crouch = false;
- }
+ FixPlayermodel(this);
- if (do_crouch) {
- if (!this.crouch) {
- this.crouch = true;
- this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this);
- setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
- // setanim(this, this.anim_duck, false, true, true); // this anim is BROKEN anyway
- }
- } else if (this.crouch) {
- tracebox(this.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), this.origin, false, this);
- if (!trace_startsolid) {
- this.crouch = false;
- this.view_ofs = STAT(PL_VIEW_OFS, this);
- setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
- }
+ if (this.shootfromfixedorigin != autocvar_g_shootfromfixedorigin) {
+ this.shootfromfixedorigin = autocvar_g_shootfromfixedorigin;
+ stuffcmd(this, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
}
- FixPlayermodel(this);
-
// LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
//if(frametime)
{
if (IS_REAL_CLIENT(this))
PrintWelcomeMessage(this);
+ local const int MIN_SPEC_TIME = 1;
if (IS_PLAYER(this)) {
+ if (IS_REAL_CLIENT(this) && time < CS(this).jointime + MIN_SPEC_TIME)
+ error("Client can't be spawned as player on connection!");
if(!PlayerThink(this))
return;
}
IntermissionThink(this);
return;
}
+ else if (IS_REAL_CLIENT(this) && !CS(this).autojoin_checked && time >= CS(this).jointime + MIN_SPEC_TIME)
+ {
+ CS(this).autojoin_checked = true;
+ // don't do this in ClientConnect
+ // many things can go wrong if a client is spawned as player on connection
+ if (MUTATOR_CALLHOOK(AutoJoinOnConnection, this)
+ || (!(autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0)
+ && (!teamplay || autocvar_g_balance_teams)))
+ {
+ campaign_bots_may_start = true;
+ Join(this);
+ return;
+ }
+ }
else if (IS_OBSERVER(this)) {
ObserverThink(this);
}
store.impulse = this.impulse;
this.impulse = 0;
- store.button0 = this.button0;
- store.button2 = this.button2;
- store.button3 = this.button3;
+ bool typing = this.buttonchat;
+
+ store.button0 = (typing) ? 0 : this.button0;
+ //button1?!
+ store.button2 = (typing) ? 0 : this.button2;
+ store.button3 = (typing) ? 0 : this.button3;
store.button4 = this.button4;
- store.button5 = this.button5;
+ store.button5 = (typing) ? 0 : this.button5;
store.button6 = this.button6;
store.button7 = this.button7;
store.button8 = this.button8;
store.ping_movementloss = this.ping_movementloss;
store.v_angle = this.v_angle;
- store.movement = this.movement;
+ store.movement = (typing) ? '0 0 0' : this.movement;
+}
+
+NET_HANDLE(fpsreport, bool)
+{
+ int fps = ReadShort();
+ PlayerScore_Set(sender, SP_FPS, fps);
+ return true;
}