From: Mario Date: Sun, 9 Sep 2018 12:44:15 +0000 (+1000) Subject: Allow persistent monster names X-Git-Tag: xonotic-v0.8.5~7^2~1^2~40 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59a213a4b63532b66162afad403b4969e15cca35;p=xonotic%2Fxonotic-data.pk3dir.git Allow persistent monster names --- 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; }