/** putting a client as observer in the server */
void PutObserverInServer(entity this)
{
- bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
+ bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
PlayerState_detach(this);
if (IS_PLAYER(this))
if (vote_called) { VoteCount(false); }
ReadyCount();
}
- }
+ }
- {
- entity spot = SelectSpawnPoint(this, true);
- if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
- this.angles = vec2(spot.angles);
- this.fixangle = true;
- // offset it so that the spectator spawns higher off the ground, looks better this way
- setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
- if (IS_REAL_CLIENT(this))
- {
- msg_entity = this;
- WriteByte(MSG_ONE, SVC_SETVIEW);
- WriteEntity(MSG_ONE, this);
- }
- // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
- // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
- if(!autocvar_g_debug_globalsounds)
- {
- // needed for player sounds
- this.model = "";
- FixPlayermodel(this);
- }
- setmodel(this, MDL_Null);
- setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
- this.view_ofs = '0 0 0';
- }
+ entity spot = SelectSpawnPoint(this, true);
+ if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
+ this.angles = vec2(spot.angles);
+ this.fixangle = true;
+ // offset it so that the spectator spawns higher off the ground, looks better this way
+ setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
+ if (IS_REAL_CLIENT(this))
+ {
+ msg_entity = this;
+ WriteByte(MSG_ONE, SVC_SETVIEW);
+ WriteEntity(MSG_ONE, this);
+ }
+ // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
+ // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
+ if(!autocvar_g_debug_globalsounds)
+ {
+ // needed for player sounds
+ this.model = "";
+ FixPlayermodel(this);
+ }
+ setmodel(this, MDL_Null);
+ setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
+ this.view_ofs = '0 0 0';
- RemoveGrapplingHooks(this);
+ RemoveGrapplingHooks(this);
Portal_ClearAll(this);
Unfreeze(this, false);
SetSpectatee(this, NULL);
if(this.monster_attack)
IL_REMOVE(g_monster_targets, this);
this.monster_attack = false;
- STAT(HUD, this) = HUD_NORMAL;
+ STAT(HUD, this) = HUD_NORMAL;
TRANSMUTE(Observer, this);
this.iscreature = false;
this.teleportable = TELEPORT_SIMPLE;
if(IS_SPEC(this))
SetSpectatee(this, NULL);
- MUTATOR_CALLHOOK(ClientDisconnect, this);
+ MUTATOR_CALLHOOK(ClientDisconnect, this);
strfree(CS(this).netname_previous); // needs to be before the CS entity is removed!
strfree(CS(this).weaponorder_byimpulse);
switch (MUTATOR_CALLHOOK(SpectatePrev, this, ent, first))
{
case MUT_SPECPREV_FOUND:
- ent = M_ARGV(1, entity);
- break;
+ ent = M_ARGV(1, entity);
+ break;
case MUT_SPECPREV_RETURN:
- return true;
+ return true;
case MUT_SPECPREV_CONTINUE:
default:
{
}
if (timeout_status == TIMEOUT_ACTIVE) {
- // don't allow the player to turn around while game is paused
+ // don't allow the player to turn around while game is paused
// FIXME turn this into CSQC stuff
this.v_angle = this.lastV_angle;
this.angles = this.lastV_angle;
return;
}
else if (timeleft <= 10) {
- if (timeleft != CS(this).idlekick_lasttimeleft) {
- Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
- }
+ if (timeleft != CS(this).idlekick_lasttimeleft)
+ Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
CS(this).idlekick_lasttimeleft = timeleft;
}
}