Send classname over the net instead of netname if there isn't one

This commit is contained in:
Marco Cawthorne 2020-01-08 02:29:29 +01:00
parent 674432f6cb
commit 6c75cb749e
5 changed files with 15 additions and 4 deletions

View file

@ -96,5 +96,7 @@ NPC_ReadEntity(float new)
if (new) {
setcustomskin(pl, "", sprintf("geomset 1 %i\n", pl.body));
}
setorigin(pl, pl.origin);
}

View file

@ -173,6 +173,11 @@ Obituary_Parse(void)
victim = readstring();
weapon = readbyte();
flags = readbyte();
if (!attacker) {
return;
}
Obituary_Add(attacker, victim, weapon, flags);
//print("Obituary received\n");
}

View file

@ -337,7 +337,7 @@ void func_door_rotating::Respawn(void)
setmodel(this, m_oldModel);
setorigin(this, m_oldOrigin);
think = __NULL__;
nextthink = -1;
nextthink = 0;
m_pMove = 0;
avelocity = [0,0,0];

View file

@ -225,8 +225,8 @@ string sci_sndscream[] = {
"scientist/scream6.wav",
"scientist/scream7.wav",
"scientist/evergetout.wav",
"scientist/scream8.wav",
"scientist/scream9.wav",
//"scientist/scream8.wav",
//"scientist/scream9.wav",
"scientist/scream10.wav",
"scientist/scream11.wav",
"scientist/getoutalive.wav",

View file

@ -20,7 +20,11 @@ Damage_Obituary(entity c, entity t, float weapon, float flags)
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_OBITUARY);
WriteString(MSG_MULTICAST, c.netname);
if (c.netname) {
WriteString(MSG_MULTICAST, c.netname);
} else {
WriteString(MSG_MULTICAST, c.classname);
}
WriteString(MSG_MULTICAST, t.netname);
WriteByte(MSG_MULTICAST, weapon);
WriteByte(MSG_MULTICAST, flags);