if(spectatee_status == -1)
s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey(_("primary fire"), "+fire"));
else
- s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
+ s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey(_("primary fire"), "+fire"), getcommandkey(_("secondary fire"), "+fire2"));
break;
case 1:
if(spectatee_status == -1)
s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
else if(!observe_blocked)
- s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("observe"), "spec"), getcommandkey(_("secondary fire"), "+fire2"));
+ s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("observe"), "spec"), getcommandkey(_("drop weapon"), "dropweapon"));
else
s = sprintf(_("^1Press ^3%s^1 to change camera mode"), getcommandkey(_("drop weapon"), "dropweapon"));
break;
{
if (!waiting_CAMERA_SPECTATOR_update)
{
- localcmd("\n+attack2; wait; -attack2\n"); // switch to CAMERA_SPECTATOR 2
+ Impulse_Send(IMP_weapon_drop); // switch to CAMERA_SPECTATOR 2
waiting_CAMERA_SPECTATOR_update = 1;
}
}
{
if (waiting_CAMERA_SPECTATOR_update != STAT(CAMERA_SPECTATOR))
{
- localcmd("\n+attack2; wait; -attack2\n"); // switch to CAMERA_SPECTATOR (2 and) 0
+ Impulse_Send(IMP_weapon_drop); // switch to CAMERA_SPECTATOR (2 and) 0
waiting_CAMERA_SPECTATOR_update = STAT(CAMERA_SPECTATOR);
}
}
return true;
}
-.int new_CAMERA_SPECTATOR;
+#define IS_WEAPNEXT_IMPULSE(imp) (imp == 10 || imp == 15 || imp == 18 || (imp >= 200 && imp <= 209))
+#define IS_WEAPPREV_IMPULSE(imp) (imp == 12 || imp == 16 || imp == 19 || (imp >= 220 && imp <= 229))
+
// merged SpectatorThink and ObserverThink (old names are here so you can grep for them)
void ObserverOrSpectatorThink(entity this)
{
int r = MinigameImpulse(this, CS(this).impulse);
if (!is_spec || r)
CS(this).impulse = 0;
- }
-
- if (is_spec)
- {
- if (PHYS_INPUT_BUTTON_ATCK2(this))
+ if (is_spec && CS(this).impulse == IMP_weapon_drop.impulse)
{
- if (this.new_CAMERA_SPECTATOR == STAT(CAMERA_SPECTATOR, this))
- this.new_CAMERA_SPECTATOR = (STAT(CAMERA_SPECTATOR, this) + 1) % 3;
+ STAT(CAMERA_SPECTATOR, this) = (STAT(CAMERA_SPECTATOR, this) + 1) % 3;
+ CS(this).impulse = 0;
+ return;
}
- else if (STAT(CAMERA_SPECTATOR, this) != this.new_CAMERA_SPECTATOR)
- STAT(CAMERA_SPECTATOR, this) = this.new_CAMERA_SPECTATOR;
}
if (frametime && autocvar_sv_show_entnum) show_entnum(this);
if (PHYS_INPUT_BUTTON_JUMP(this) && (joinAllowed(this, this.wants_join) || time < CS(this).jointime + MIN_SPEC_TIME)) {
this.flags &= ~FL_JUMPRELEASED;
this.flags |= FL_SPAWNING;
- } else if((is_spec && (PHYS_INPUT_BUTTON_ATCK(this) || CS(this).impulse == 10 || CS(this).impulse == 15 || CS(this).impulse == 18 || (CS(this).impulse >= 200 && CS(this).impulse <= 209)))
+ } else if((is_spec && (PHYS_INPUT_BUTTON_ATCK(this) || IS_WEAPNEXT_IMPULSE(CS(this).impulse)))
|| (!is_spec && ((PHYS_INPUT_BUTTON_ATCK(this) && !CS(this).version_mismatch) || this.would_spectate))) {
this.flags &= ~FL_JUMPRELEASED;
if(SpectateNext(this)) {
if (is_spec)
CS(this).impulse = 0;
} else if (is_spec) {
- if(CS(this).impulse == 12 || CS(this).impulse == 16 || CS(this).impulse == 19 || (CS(this).impulse >= 220 && CS(this).impulse <= 229)) {
+ if(PHYS_INPUT_BUTTON_ATCK2(this) || IS_WEAPPREV_IMPULSE(CS(this).impulse)) {
this.flags &= ~FL_JUMPRELEASED;
if(SpectatePrev(this)) {
TRANSMUTE(Spectator, this);
set_movetype(this, preferred_movetype);
}
} else { // jump pressed
- if ((is_spec && !(PHYS_INPUT_BUTTON_ATCK(this)))
+ if ((is_spec && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this)))
|| (!is_spec && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this)))) {
this.flags |= FL_JUMPRELEASED;
// primary attack pressed
if (is_spec)
this.flags |= FL_CLIENT | FL_NOTARGET;
}
+#undef IS_WEAPNEXT_IMPULSE
+#undef IS_WEAPPREV_IMPULSE
void PlayerUseKey(entity this)
{