From 59a213a4b63532b66162afad403b4969e15cca35 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 9 Sep 2018 22:44:15 +1000 Subject: [PATCH] Allow persistent monster names --- qcsrc/common/monsters/sv_monsters.qc | 4 +++- qcsrc/server/command/common.qc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 517e8494c8..938d22c464 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -1352,6 +1352,9 @@ bool Monster_Spawn(entity this, bool check_appear, int mon_id) else setmodel(this, mon.m_model); + if(!this.monster_name || this.monster_name == "") + this.monster_name = mon.monster_name; + this.flags = FL_MONSTER; this.classname = "monster"; this.takedamage = DAMAGE_AIM; @@ -1379,7 +1382,6 @@ bool Monster_Spawn(entity this, bool check_appear, int mon_id) this.reset = Monster_Reset; this.netname = mon.netname; this.monster_attackfunc = mon.monster_attackfunc; - this.monster_name = mon.monster_name; this.candrop = true; this.oldtarget2 = this.target2; //this.pass_distance = 0; diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 643afa3f17..c39a1ba5ce 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -354,7 +354,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) string mon_oldname = mon.monster_name; mon.monster_name = argument; - if (mon.sprite) WaypointSprite_UpdateSprites(mon.sprite, WP_Monster, WP_Null, WP_Null); + if (mon.sprite) WaypointSprite_UpdateSprites(mon.sprite, WP_Monster, WP_Null, WP_Null); // TODO: the new name is never actually sent to CSQC! print_to(caller, sprintf("Your pet '%s' is now known as '%s'", mon_oldname, mon.monster_name)); return; } -- 2.39.2