From 2e32f2e7d3253f16c66a3f381fa7bd45328a0f10 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Fri, 20 Dec 2024 17:00:47 +0800 Subject: [PATCH] Use m_name for vehicles and monsters 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. --- qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc | 2 +- .../common/gamemodes/gamemode/invasion/sv_invasion.qc | 2 +- qcsrc/common/monsters/monster.qh | 2 +- qcsrc/common/monsters/monster/golem.qh | 2 +- qcsrc/common/monsters/monster/mage.qh | 2 +- qcsrc/common/monsters/monster/spider.qh | 2 +- qcsrc/common/monsters/monster/wyvern.qh | 2 +- qcsrc/common/monsters/monster/zombie.qh | 2 +- qcsrc/common/monsters/sv_monsters.qc | 4 ++-- .../mutators/mutator/waypoints/waypointsprites.qc | 2 +- qcsrc/common/vehicles/vehicle.qh | 4 ++-- qcsrc/common/vehicles/vehicle/bumblebee.qh | 2 +- qcsrc/common/vehicles/vehicle/racer.qh | 2 +- qcsrc/common/vehicles/vehicle/raptor.qh | 2 +- qcsrc/common/vehicles/vehicle/spiderbot.qh | 2 +- qcsrc/server/command/common.qc | 10 +++++----- 16 files changed, 22 insertions(+), 22 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index 39f45666d..48657df2e 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -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) { diff --git a/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc index a28b71409..ca57d6fd7 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc +++ b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc @@ -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) diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index 87b89216a..87b0d186e 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -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 */ diff --git a/qcsrc/common/monsters/monster/golem.qh b/qcsrc/common/monsters/monster/golem.qh index 02266de8d..5414b2529 100644 --- a/qcsrc/common/monsters/monster/golem.qh +++ b/qcsrc/common/monsters/monster/golem.qh @@ -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)) { diff --git a/qcsrc/common/monsters/monster/mage.qh b/qcsrc/common/monsters/monster/mage.qh index aa7e5a0c8..89b1ad6a7 100644 --- a/qcsrc/common/monsters/monster/mage.qh +++ b/qcsrc/common/monsters/monster/mage.qh @@ -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)) { diff --git a/qcsrc/common/monsters/monster/spider.qh b/qcsrc/common/monsters/monster/spider.qh index ee7257db7..7ad449889 100644 --- a/qcsrc/common/monsters/monster/spider.qh +++ b/qcsrc/common/monsters/monster/spider.qh @@ -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)) { diff --git a/qcsrc/common/monsters/monster/wyvern.qh b/qcsrc/common/monsters/monster/wyvern.qh index cb90f9a08..0b4edf000 100644 --- a/qcsrc/common/monsters/monster/wyvern.qh +++ b/qcsrc/common/monsters/monster/wyvern.qh @@ -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)) { diff --git a/qcsrc/common/monsters/monster/zombie.qh b/qcsrc/common/monsters/monster/zombie.qh index 8d12fb44e..5a7054d71 100644 --- a/qcsrc/common/monsters/monster/zombie.qh +++ b/qcsrc/common/monsters/monster/zombie.qh @@ -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)) { diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index b71e1054d..a23a81b99 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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) { diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index c9d4d9a73..f3172c711 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -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); diff --git a/qcsrc/common/vehicles/vehicle.qh b/qcsrc/common/vehicles/vehicle.qh index 337e56c39..dd6960fd1 100644 --- a/qcsrc/common/vehicles/vehicle.qh +++ b/qcsrc/common/vehicles/vehicle.qh @@ -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 */ diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qh b/qcsrc/common/vehicles/vehicle/bumblebee.qh index 68171e5f5..a380d9d75 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qh +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qh @@ -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)) diff --git a/qcsrc/common/vehicles/vehicle/racer.qh b/qcsrc/common/vehicles/vehicle/racer.qh index a10ce29ec..5797411a8 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qh +++ b/qcsrc/common/vehicles/vehicle/racer.qh @@ -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)) diff --git a/qcsrc/common/vehicles/vehicle/raptor.qh b/qcsrc/common/vehicles/vehicle/raptor.qh index c1e7c878e..c4ce6699e 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qh +++ b/qcsrc/common/vehicles/vehicle/raptor.qh @@ -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)) diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qh b/qcsrc/common/vehicles/vehicle/spiderbot.qh index 3c0adcd57..dd68811e0 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qh +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qh @@ -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)) diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 71da040ed..a197312c5 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -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": -- 2.39.2