#include "clientkill.qh"
-#include <server/defs.qh>
-
-#include "g_damage.qh"
-#include "teamplay.qh"
-
-#include <common/vehicles/sv_vehicles.qh>
+#include <common/csqcmodel_settings.qh>
+#include <common/deathtypes/all.qh>
+#include <common/mapobjects/triggers.qh>
#include <common/notifications/all.qh>
#include <common/stats.qh>
+#include <common/stats.qh>
+#include <common/vehicles/sv_vehicles.qh>
+#include <common/weapons/_all.qh>
+#include <server/client.qh>
+#include <server/damage.qh>
+#include <server/mutators/_mod.qh>
+#include <server/player.qh>
+#include <server/teamplay.qh>
void ClientKill_Now_TeamChange(entity this)
{
PutObserverInServer(this);
}
else
- SV_ChangeTeam(this, this.killindicator_teamchange - 1);
+ {
+ Player_SetTeamIndexChecked(this, Team_TeamToIndex(
+ this.killindicator_teamchange));
+ }
this.killindicator_teamchange = 0;
}
this.killindicator_teamchange = targetteam;
+ // this.killindicator.count == 1 means that the kill indicator was spawned by ClientKill_Silent
+ if(killtime <= 0 && this.killindicator && this.killindicator.count == 1)
+ {
+ ClientKill_Now(this); // allow instant kill in this case
+ return;
+ }
+
if (!this.killindicator)
{
if (!IS_DEAD(this))
{
float starttime = max(time, clientkilltime);
- this.killindicator = spawn();
+ this.killindicator = new(killindicator);
this.killindicator.owner = this;
this.killindicator.scale = 0.5;
setattachment(this.killindicator, this, "");
this.killindicator.count = bound(0, ceil(killtime), 10);
//sprint(this, strcat("^1You'll be dead in ", ftos(this.killindicator.cnt), " seconds\n"));
- IL_EACH(g_clones, it.enemy == this && !(it.effects & CSQCMODEL_EF_RESPAWNGHOST),
+ IL_EACH(g_clones, it.enemy == this && !(it.effects & CSQCMODEL_EF_RESPAWNGHOST) && !it.killindicator,
{
- it.killindicator = spawn();
+ it.killindicator = new(killindicator);
it.killindicator.owner = it;
it.killindicator.scale = 0.5;
setattachment(it.killindicator, it, "");
}
+void ClientKill_Silent(entity this, float _delay)
+{
+ this.killindicator = new(killindicator);
+ this.killindicator.owner = this;
+ setthink(this.killindicator, KillIndicator_Think);
+ this.killindicator.nextthink = time + (this.lip) * 0.05;
+ this.killindicator.cnt = ceil(_delay);
+ this.killindicator.count = 1; // this is used to indicate that it should be silent
+ this.lip = 0;
+}
+
// Called when a client types 'kill' in the console
void ClientKill(entity this)
{
- // TODO: once .health is removed, will need to check it here for the "already dead" message!
-
if (game_stopped || this.player_blocked || STAT(FROZEN, this))
return;