.entity pusher;
.float pushltime;
+.float istypefrag;
.float CopyBody_nextthink;
.void(void) CopyBody_think;
self.animstate_endtime = oldself.animstate_endtime;
self.animstate_override = oldself.animstate_override;
self.animstate_looping = oldself.animstate_looping;
+ self.dphitcontentsmask = oldself.dphitcontentsmask;
+ self.death_time = oldself.death_time;
self.frame = oldself.frame;
- self.dead_frame = oldself.dead_frame;
self.pain_finished = oldself.pain_finished;
self.health = oldself.health;
self.armorvalue = oldself.armorvalue;
if (keepvelocity == 1)
self.velocity = oldself.velocity;
self.oldvelocity = self.velocity;
+ self.alpha = oldself.alpha;
self.fade_time = oldself.fade_time;
self.fade_rate = oldself.fade_rate;
//self.weapon = oldself.weapon;
Drag_MoveDrag(oldself, self);
if(self.colormap <= maxclients && self.colormap > 0)
- self.colormap = 1024 + self.clientcolors;
+ self.colormap = 1024 + oldself.clientcolors;
CSQCMODEL_AUTOINIT();
self.CopyBody_nextthink = oldself.nextthink;
self.anim_runbackwards = animfixfps(self, '14 1 1');
self.anim_strafeleft = animfixfps(self, '15 1 1');
self.anim_straferight = animfixfps(self, '16 1 1');
- self.anim_dead1 = animfixfps(self, '17 1 1');
- self.anim_dead2 = animfixfps(self, '18 1 1');
+ //self.anim_dead1 = animfixfps(self, '17 1 1');
+ //self.anim_dead2 = animfixfps(self, '18 1 1');
self.anim_forwardright = animfixfps(self, '19 1 1');
self.anim_forwardleft = animfixfps(self, '20 1 1');
self.anim_backright = animfixfps(self, '21 1 1');
updateanim(self.weaponentity);
if (self.deadflag != DEAD_NO)
- {
- if (time > self.animstate_endtime)
- {
- if (self.maxs_z > 5)
- {
- self.maxs_z = 5;
- setsize(self, self.mins, self.maxs);
- }
- self.frame = self.dead_frame;
- }
return;
- }
if (!self.animstate_override)
{
float j;
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
{
- if(self.weapons & W_WeaponBit(j))
+ if(WEPSET_CONTAINS_EW(self, j))
if(W_IsWeaponThrowable(j))
W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
}
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
self.dmg_inflictor = inflictor;
- if (self.health <= -autocvar_sv_gibhealth && !(self.effects & CSQCMODEL_EF_INVISIBLE))
+ if (self.health <= -autocvar_sv_gibhealth && self.alpha >= 0)
{
// don't use any animations as a gib
self.frame = 0;
- self.dead_frame = 0;
// view just above the floor
self.view_ofs = '0 0 4';
Violence_GibSplash(self, 1, 1, attacker);
- self.effects |= CSQCMODEL_EF_INVISIBLE;
+ self.alpha = -1;
self.solid = SOLID_NOT; // restore later
+ self.takedamage = DAMAGE_NO; // restore later
}
}
float valid_damage_for_weaponstats;
float excess;
- if((g_arena && numspawned < 2) || (g_ca && !ca_teams_ok) && !inWarmupStage)
+ if((g_arena && numspawned < 2) || (g_ca && allowed_to_spawn) && !inWarmupStage)
return;
dh = max(self.health, 0);
// don't reset pushltime for self damage as it may be an attempt to
// escape a lava pit or similar
//self.pushltime = 0;
+ self.istypefrag = 0;
}
else if(attacker.classname == "player")
{
self.pusher = attacker;
self.pushltime = time + autocvar_g_maxpushtime;
+ self.istypefrag = self.BUTTON_CHAT;
}
else if(time < self.pushltime)
{
self.pushltime = max(self.pushltime, time + 0.6);
}
else
+ {
self.pushltime = 0;
+ self.istypefrag = 0;
+ }
float abot, vbot, awep;
abot = (clienttype(attacker) == CLIENTTYPE_BOT);
vbot = (clienttype(self) == CLIENTTYPE_BOT);
valid_damage_for_weaponstats = 0;
+ awep = 0;
+
if(vbot || clienttype(self) == CLIENTTYPE_REAL)
if(abot || clienttype(attacker) == CLIENTTYPE_REAL)
if(attacker && self != attacker)
if(!g_freezetag)
{
// become fully visible
- self.alpha = 1;
+ self.alpha = default_player_alpha;
// throw a weapon
SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
}
else
DropFlag(self.flagcarried, world, attacker);
}
- if(self.ballcarried && g_nexball)
- DropBall(self.ballcarried, self.origin, self.velocity);
Portal_ClearAllLater(self);
if(clienttype(self) == CLIENTTYPE_REAL)
if(!waves)
waves = autocvar_g_respawn_waves;
if(waves)
- self.death_time = ceil((time + sdelay) / waves) * waves;
+ self.respawn_time = ceil((time + sdelay) / waves) * waves;
else
- self.death_time = time + sdelay;
- if((sdelay + waves >= 5.0) && (self.death_time - time > 1.75))
+ self.respawn_time = time + sdelay;
+ if((sdelay + waves >= 5.0) && (self.respawn_time - time > 1.75))
self.respawn_countdown = 10; // first number to count down from is 10
else
self.respawn_countdown = -1; // do not count down
+ self.death_time = time;
if (random() < 0.5)
- {
setanim(self, self.anim_die1, FALSE, TRUE, TRUE);
- self.dead_frame = self.anim_dead1_x;
- }
else
- {
setanim(self, self.anim_die2, FALSE, TRUE, TRUE);
- self.dead_frame = self.anim_dead2_x;
+ if (self.maxs_z > 5)
+ {
+ self.maxs_z = 5;
+ setsize(self, self.mins, self.maxs);
}
// set damage function to corpse damage
self.event_damage = PlayerCorpseDamage;
// 0 = reject
// -1 = fake accept
{
- string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, privatemsgprefix;
- float flood, privatemsgprefixlen;
+ string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr;
+ float flood;
var .float flood_field;
entity head;
float ret;
-
- if(Ban_MaybeEnforceBan(source))
- return 0;
+ string privatemsgprefix = string_null; float privatemsgprefixlen = 0;
if(!teamsay && !privatesay)
if(substring(msgin, 0, 1) == " ")
else if(teamplay)
colorstr = Team_ColorCode(source.team);
else
+ {
+ colorstr = "";
teamsay = FALSE;
+ }
if(intermission_running)
teamsay = FALSE;
// FLOOD CONTROL
flood = 0;
+ flood_field = floodcontrol_chat;
if(floodcontrol)
{
float flood_spl;
flood = 1;
}
- if (timeoutStatus == 2) //when game is paused, no flood protection
+ if (timeout_status == TIMEOUT_ACTIVE) // when game is paused, no flood protection
source.flood_field = flood = 0;
}
if(!privatesay)
if(source.classname != "player")
{
- if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
- teamsay = -1; // spectators
+ if not(intermission_running)
+ if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(inWarmupStage || gameover)))
+ teamsay = -1; // spectators
}
if(flood)
if(sourcemsgstr != "" && ret != 0)
{
- if(ret < 0) // fake
+ if(ret < 0) // faked message, because the player is muted
{
sprint(source, sourcemsgstr);
if(sourcecmsgstr != "" && !privatesay)
centerprint(source, sourcecmsgstr);
}
- else if(privatesay)
+ else if(privatesay) // private message, between 2 people only, not sent to server console
{
sprint(source, sourcemsgstr);
sprint(privatesay, msgstr);
if(cmsgstr != "")
centerprint(privatesay, cmsgstr);
}
- else if(teamsay > 0)
+ else if(teamsay > 0) // team message, only sent to team mates
{
sprint(source, sourcemsgstr);
+ //print(msgstr); // send to server console too
if(sourcecmsgstr != "")
centerprint(source, sourcecmsgstr);
FOR_EACH_REALPLAYER(head) if(head.team == source.team)
centerprint(head, cmsgstr);
}
}
- else if(teamsay < 0)
+ else if(teamsay < 0) // spectator message, only sent to spectators
{
sprint(source, sourcemsgstr);
+ //print(msgstr); // send to server console too
FOR_EACH_REALCLIENT(head) if(head.classname != "player")
if(head != source)
sprint(head, msgstr);
}
- else if(sourcemsgstr != msgstr)
+ else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players
{
sprint(source, sourcemsgstr);
+ //print(msgstr); // send to server console too
FOR_EACH_REALCLIENT(head)
if(head != source)
sprint(head, msgstr);
}
else
- bprint(msgstr);
+ bprint(msgstr); // entirely normal message, sent to all players -- bprint sends to server console too.
}
return ret;