#include <common/effects/qc/globalsound.qh>
#include <common/ent_cs.qh>
#include <common/gamemodes/_mod.qh>
-#include <common/gamemodes/gamemode/lms/sv_lms.qh>
#include <common/gamemodes/gamemode/nexball/sv_nexball.qh>
#include <common/items/_mod.qh>
#include <common/items/inventory.qh>
}
/** putting a client as observer in the server */
-void PutObserverInServer(entity this)
+void PutObserverInServer(entity this, bool is_forced)
{
- bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
+ bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this, is_forced);
PlayerState_detach(this);
if (IS_PLAYER(this))
MUTATOR_CALLHOOK(PutClientInServer, this);
if (IS_OBSERVER(this)) {
- PutObserverInServer(this);
+ PutObserverInServer(this, false);
} else if (IS_PLAYER(this)) {
PutPlayerInServer(this);
}
accuracy_resend(this);
if(!SpectateUpdate(this))
- PutObserverInServer(this);
+ PutObserverInServer(this, false);
return true;
}
TRANSMUTE(Observer, this);
PutClientInServer(this);
} else if(!SpectateUpdate(this) && !SpectateNext(this)) {
- PutObserverInServer(this);
+ PutObserverInServer(this, false);
this.would_spectate = true;
}
}
}
}
if(is_spec && !SpectateUpdate(this))
- PutObserverInServer(this);
+ PutObserverInServer(this, false);
}
if (is_spec)
this.flags |= FL_CLIENT | FL_NOTARGET;
if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time);
- if (this.caplayer)
- this.caplayer = 0;
- this.lms_spectate_warning = 2; // TODO: mutator hook for players forcibly moved to spectator?
- PutObserverInServer(this);
+ PutObserverInServer(this, true);
}
else
{