]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use m_name for vehicles and monsters
authorotta8634 <k9wolf@pm.me>
Fri, 20 Dec 2024 09:00:47 +0000 (17:00 +0800)
committerotta8634 <k9wolf@pm.me>
Fri, 20 Dec 2024 09:00:47 +0000 (17:00 +0800)
Previously monster_name and vehicle_name were used, which were obviously used nowhere else.
Renamed them both to m_name, mostly so that the COLORED_NAME macro can work on them, and also so that there's less unnecessary entity fields.

16 files changed:
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc
qcsrc/common/monsters/monster.qh
qcsrc/common/monsters/monster/golem.qh
qcsrc/common/monsters/monster/mage.qh
qcsrc/common/monsters/monster/spider.qh
qcsrc/common/monsters/monster/wyvern.qh
qcsrc/common/monsters/monster/zombie.qh
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/vehicles/vehicle.qh
qcsrc/common/vehicles/vehicle/bumblebee.qh
qcsrc/common/vehicles/vehicle/racer.qh
qcsrc/common/vehicles/vehicle/raptor.qh
qcsrc/common/vehicles/vehicle/spiderbot.qh
qcsrc/server/command/common.qc

index 39f45666db19a944fe151ae9ea4467798c27a5a8..48657df2e2d5411f62eeb8daf3c78bfde1f66828 100644 (file)
@@ -680,7 +680,7 @@ void ctf_Handle_Return(entity flag, entity player)
        // messages and sounds
        if(IS_MONSTER(player))
        {
-               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(flag.team, INFO_CTF_RETURN_MONSTER), player.monster_name);
+               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(flag.team, INFO_CTF_RETURN_MONSTER), player.m_name);
        }
        else if(flag.team)
        {
index a28b7140929dfb9e28df5902ea6ca80c151eaac8..ca57d6fd7873f4e199ac8900ef275c9b48f99505 100644 (file)
@@ -379,7 +379,7 @@ MUTATOR_HOOKFUNCTION(inv, MonsterSpawn)
        mon.monster_skill = inv_monsterskill;
 
        if(mon.monsterdef.spawnflags & MON_FLAG_SUPERMONSTER)
-               Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
+               Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.m_name);
 }
 
 MUTATOR_HOOKFUNCTION(inv, SV_StartFrame)
index 87b89216a8771646a0db23445d49419854e55805..87b0d186eed6fc166a085745000a1e8c90cfbc56 100644 (file)
@@ -33,7 +33,7 @@ CLASS(Monster, Object)
     /** attributes */
     ATTRIB(Monster, spawnflags, int, 0);
     /** human readable name */
-    ATTRIB(Monster, monster_name, string, _("Monster"));
+    ATTRIB(Monster, m_name, string, _("Monster"));
     /** short name */
     ATTRIB(Monster, netname, string, "");
     /** color */
index 02266de8d67d0dca8cd8edab16afaed2d2d6a47f..5414b25293d06df4f7cd24aeacf052ce483c0efd 100644 (file)
@@ -14,7 +14,7 @@ CLASS(Golem, Monster)
     ATTRIB(Golem, m_model, Model, MDL_MON_GOLEM);
 #endif
     ATTRIB(Golem, netname, string, "golem");
-    ATTRIB(Golem, monster_name, string, _("Golem"));
+    ATTRIB(Golem, m_name, string, _("Golem"));
 #ifdef MENUQC
     METHOD(Golem, describe, string(Golem this))
     {
index aa7e5a0c89c9183b687d71c4d00d5ef04f150267..89b1ad6a774f40b9e990fd04d9296a70c1dd5df9 100644 (file)
@@ -14,7 +14,7 @@ CLASS(Mage, Monster)
     ATTRIB(Mage, m_model, Model, MDL_MON_MAGE);
 #endif
     ATTRIB(Mage, netname, string, "mage");
-    ATTRIB(Mage, monster_name, string, _("Mage"));
+    ATTRIB(Mage, m_name, string, _("Mage"));
 #ifdef MENUQC
     METHOD(Mage, describe, string(Mage this))
     {
index ee7257db791e5b588a87ca9bc8c5708d26a91503..7ad4498899a4b89fa4b80fb3f984da9e449f25dc 100644 (file)
@@ -15,7 +15,7 @@ CLASS(Spider, Monster)
     ATTRIB(Spider, m_model, Model, MDL_MON_SPIDER);
 #endif
     ATTRIB(Spider, netname, string, "spider");
-    ATTRIB(Spider, monster_name, string, _("Spider"));
+    ATTRIB(Spider, m_name, string, _("Spider"));
 #ifdef MENUQC
     METHOD(Spider, describe, string(Spider this))
     {
index cb90f9a08b6ab6761d0717e4891ff37be30f4027..0b4edf0006860c8da99d953a4f733abe04169f0e 100644 (file)
@@ -14,7 +14,7 @@ CLASS(Wyvern, Monster)
     ATTRIB(Wyvern, m_model, Model, MDL_MON_WYVERN);
 #endif
     ATTRIB(Wyvern, netname, string, "wyvern");
-    ATTRIB(Wyvern, monster_name, string, _("Wyvern"));
+    ATTRIB(Wyvern, m_name, string, _("Wyvern"));
 #ifdef MENUQC
     METHOD(Wyvern, describe, string(Wyvern this))
     {
index 8d12fb44efa0b1614b7bf1ebd31412b34b578fe8..5a7054d7162f03103c3643f3eac888f8dd37d0d7 100644 (file)
@@ -14,7 +14,7 @@ CLASS(Zombie, Monster)
     ATTRIB(Zombie, m_model, Model, MDL_MON_ZOMBIE);
 #endif
     ATTRIB(Zombie, netname, string, "zombie");
-    ATTRIB(Zombie, monster_name, string, _("Zombie"));
+    ATTRIB(Zombie, m_name, string, _("Zombie"));
 #ifdef MENUQC
     METHOD(Zombie, describe, string(Zombie this))
     {
index b71e1054d6db5e7d49f94d13f58442635b1d1614..a23a81b9938912a57a5867b9c16509f6b30f4867 100644 (file)
@@ -1459,8 +1459,8 @@ bool Monster_Spawn(entity this, bool check_appear, Monster mon)
        else
                setmodel(this, mon.m_model);
 
-       if(!this.monster_name || this.monster_name == "")
-               this.monster_name = mon.monster_name;
+       if(!this.m_name || this.m_name == "")
+               this.m_name = mon.m_name;
 
        if(this.statuseffects && this.statuseffects.owner == this)
        {
index c9d4d9a733f2378bb0b3bc974e9b71e072cbc508..f3172c7110ece1c162dccf95bbc112884f5f7ce9 100644 (file)
@@ -237,7 +237,7 @@ string spritelookuptext(entity this, string s)
     if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
     if (s == WP_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).m_name;
     if (s == WP_Item.netname) return REGISTRY_GET(Items, this.wp_extra).m_waypoint;
-    if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).monster_name;
+    if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).m_name;
     if (MUTATOR_CALLHOOK(WP_Format, this, s))
     {
         return M_ARGV(3, string);
index 337e56c39db220c9b4b1f028c03ac1f4336ea39f..dd6960fd136e45af76a1c0877eda23de76d5603a 100644 (file)
@@ -7,7 +7,7 @@ CLASS(Vehicle, Object)
     /** short name */
     ATTRIB(Vehicle, netname, string, "");
     /** human readable name */
-    ATTRIB(Vehicle, vehicle_name, string, _("Vehicle"));
+    ATTRIB(Vehicle, m_name, string, _("Vehicle"));
     /** color */
     ATTRIB(Vehicle, m_color, vector, '1 1 1');
     /** full name of model */
@@ -44,7 +44,7 @@ CLASS(Vehicle, Object)
     }
 #endif
     METHOD(Vehicle, display, void(entity this, void(string name, string icon) returns)) {
-        returns(this.vehicle_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
+        returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
     }
 
     /** (BOTH) setup vehicle data */
index 68171e5f5f1d3ac6dab92db79c9cc8c4ed28e14a..a380d9d7597906d4f2900e4d106fee8394be735b 100644 (file)
@@ -18,7 +18,7 @@ CLASS(Bumblebee, Vehicle)
 /* tags       */ ATTRIB(Bumblebee, tag_view, string, "tag_viewport");
 #endif
 /* netname    */ ATTRIB(Bumblebee, netname, string, "bumblebee");
-/* fullname   */ ATTRIB(Bumblebee, vehicle_name, string, _("Bumblebee"));
+/* fullname   */ ATTRIB(Bumblebee, m_name, string, _("Bumblebee"));
 /* icon       */ ATTRIB(Bumblebee, m_icon, string, "vehicle_bumble");
 #ifdef MENUQC
 METHOD(Bumblebee, describe, string(Bumblebee this))
index a10ce29ec6a979290b59c2dfdc5f928cc2e86318..5797411a8cfdd7f07debf00e50cf4bf85599e4bd 100644 (file)
@@ -18,7 +18,7 @@ CLASS(Racer, Vehicle)
 /* tags       */ ATTRIB(Racer, tag_view, string, "tag_viewport");
 #endif
 /* netname    */ ATTRIB(Racer, netname, string, "racer");
-/* fullname   */ ATTRIB(Racer, vehicle_name, string, _("Racer"));
+/* fullname   */ ATTRIB(Racer, m_name, string, _("Racer"));
 /* icon       */ ATTRIB(Racer, m_icon, string, "vehicle_racer");
 #ifdef MENUQC
 METHOD(Racer, describe, string(Racer this))
index c1e7c878e08c34ca29b8370272a947f106ee07b0..c4ce6699eadca25c61026d40de4f24134dc8ec3d 100644 (file)
@@ -18,7 +18,7 @@ CLASS(Raptor, Vehicle)
 /* tags       */ ATTRIB(Raptor, tag_view, string, "tag_camera");
 #endif
 /* netname    */ ATTRIB(Raptor, netname, string, "raptor");
-/* fullname   */ ATTRIB(Raptor, vehicle_name, string, _("Raptor"));
+/* fullname   */ ATTRIB(Raptor, m_name, string, _("Raptor"));
 /* icon       */ ATTRIB(Raptor, m_icon, string, "vehicle_raptor");
 #ifdef MENUQC
 METHOD(Raptor, describe, string(Raptor this))
index 3c0adcd575c8aa8c670fe54ba348a63535ce9641..dd68811e04030f2b38d406ebc51844f99ed8dc63 100644 (file)
@@ -18,7 +18,7 @@ CLASS(Spiderbot, Vehicle)
 /* tags       */ ATTRIB(Spiderbot, tag_view, string, "");
 #endif
 /* netname    */ ATTRIB(Spiderbot, netname, string, "spiderbot");
-/* fullname   */ ATTRIB(Spiderbot, vehicle_name, string, _("Spiderbot"));
+/* fullname   */ ATTRIB(Spiderbot, m_name, string, _("Spiderbot"));
 /* icon       */ ATTRIB(Spiderbot, m_icon, string, "vehicle_spider");
 #ifdef MENUQC
 METHOD(Spiderbot, describe, string(Spiderbot this))
index 71da040ed31f204ae3be49d7e46696d6b1365b0d..a197312c51a9046561b102e14c24a1010f7a40b3 100644 (file)
@@ -341,11 +341,11 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                        if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; }
                                        if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
 
-                                       string mon_oldname = mon.monster_name;
+                                       string mon_oldname = mon.m_name;
 
-                                       mon.monster_name = argument;
+                                       mon.m_name = argument;
                                        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));
+                                       print_to(caller, sprintf("Your pet '%s' is now known as '%s'", mon_oldname, mon.m_name));
                                        return;
                                }
                                case "spawn":
@@ -386,7 +386,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                        totalspawned += 1;
                                        WarpZone_TraceBox(CENTER_OR_VIEWOFS(caller), caller.mins, caller.maxs, CENTER_OR_VIEWOFS(caller) + v_forward * 150, true, caller);
                                        mon = spawnmonster(spawn(), arg_lower, MON_Null, caller, caller, trace_endpos, false, false, moveflag);
-                                       print_to(caller, strcat("Spawned ", mon.monster_name));
+                                       print_to(caller, strcat("Spawned ", mon.m_name));
                                        return;
                                }
                                case "kill":
@@ -396,7 +396,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                        if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
 
                                        Damage(mon, NULL, NULL, GetResource(mon, RES_HEALTH) + mon.max_health + 200, DEATH_KILL.m_id, DMG_NOWEP, mon.origin, '0 0 0');
-                                       print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated"));
+                                       print_to(caller, strcat("Your pet '", mon.m_name, "' has been brutally mutilated"));
                                        return;
                                }
                                case "skin":