From 755a94b500933734e4c2d4a834b59d10f397b2ad Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 27 May 2020 22:20:32 +0200 Subject: [PATCH] Weapons_fromstr --> Weapon_from_name --- qcsrc/common/weapons/all.qh | 2 +- qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- qcsrc/server/weapons/spawning.qc | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 1a6dddbc2..bcd4d51a4 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -127,7 +127,7 @@ STATIC_INIT_LATE(W_PROP_reloader) REGISTER_WEAPON(Null, NEW(Weapon)); REGISTRY_DEFINE_GET(Weapons, WEP_Null) -Weapon Weapons_fromstr(string s) +Weapon Weapon_from_name(string s) { FOREACH(Weapons, it != WEP_Null && it.netname == s, return it); return WEP_Null; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc index e8dcd7999..7ef517296 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc @@ -37,7 +37,7 @@ string WeaponArenaString() s = ""; for(int j = 0; j < n; ++j) { - Weapon wep = Weapons_fromstr(argv(j)); + Weapon wep = Weapon_from_name(argv(j)); if(wep != WEP_Null) { s = cons_mid(s, " & ", wep.m_name); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 6e2fe4b16..d4d5d3494 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -719,7 +719,7 @@ void readplayerstartcvars() for (int j = 0; j < t; ++j) { s = argv(j); - Weapon wep = Weapons_fromstr(s); + Weapon wep = Weapon_from_name(s); if(wep != WEP_Null) { g_weaponarena_weapons |= (wep.m_wepset); diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 93c49af9b..881d431ae 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -14,7 +14,7 @@ string W_Apply_Weaponreplace(string in) string out = ""; FOREACH_WORD(in, true, { string replacement = ""; - Weapon w = Weapons_fromstr(it); + Weapon w = Weapon_from_name(it); if (w) { replacement = w.weaponreplace; @@ -55,7 +55,7 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn) for (int i = 1; i < t; ++i) { s = argv(i); - Weapon wep = Weapons_fromstr(s); + Weapon wep = Weapon_from_name(s); if(wep != WEP_Null) { entity replacement = spawn(); @@ -68,7 +68,7 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn) if (t >= 1) // always the case! { s = argv(0); - wpn = Weapons_fromstr(s); + wpn = Weapon_from_name(s); } if (wpn == WEP_Null) { -- 2.39.2