]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Player templates: Renamed num_random_start_weapons to random_start_weapons_count.
authorLyberta <lyberta@lyberta.net>
Fri, 18 Aug 2017 09:02:56 +0000 (12:02 +0300)
committerLyberta <lyberta@lyberta.net>
Fri, 18 Aug 2017 09:02:56 +0000 (12:02 +0300)
player-template-example.cfg
qcsrc/common/mutators/mutator/playertemplates/sv_playertemplates.qc

index f418b32f324e8aad323618b0634be5d98439a232..73763644422764ff6f35d5f280e0642743aaab9d 100644 (file)
@@ -18,8 +18,8 @@ set g_player_template_example_default_start_weapons "default" "Whether to give p
 set g_player_template_example_start_weapons "default" "Which weapons does player get during spawn"
 // These weapons will be given randomly. The player will get the exact amount of
 // random weapons. The code will make sure that they are not duplicate.
-set g_player_template_example_num_random_start_weapons 0 "Number of weapons that can be randomly given to player during spawn"
-set g_player_template_example_random_start_weapons "" "Weapons that can be randomly given to player during spawn"
+set g_player_template_example_random_start_weapons_count "default" "Number of weapons that can be randomly given to player during spawn"
+set g_player_template_example_random_start_weapons "default" "Weapons that can be randomly given to player during spawn"
 set g_player_template_example_random_start_shells "default" "How much shells does the player get with random start shell-based weapon"
 set g_player_template_example_random_start_bullets "default" "How much bullets does the player get with random start bullet-based weapon"
 set g_player_template_example_random_start_rockets "default" "How much rockets does the player get with random start rocket-based weapon"
index 1ad8dea6cbaf6e8cb7356220c878737ec0943c4e..027c1f26bb2429f87937cc0febe6dbf1212d165d 100644 (file)
@@ -47,6 +47,14 @@ string PlayerTemplate_GetDefaultCvarName(string variable)
                {
                        return "g_start_ammo_fuel";
                }
+               case "random_start_weapons_count":
+               {
+                       return "g_random_start_weapons_count";
+               }
+               case "random_start_weapons":
+               {
+                       return "g_random_start_weapons";
+               }
                case "random_start_shells":
                {
                        return "g_random_start_shells";
@@ -111,6 +119,7 @@ float PlayerTemplate_GetDefaultFloatValue(string variable)
                case "start_ammo_cells":
                case "start_ammo_plasma":
                case "start_ammo_fuel":
+               case "random_start_weapons_count":
                case "random_start_shells":
                case "random_start_bullets":
                case "random_start_rockets":
@@ -133,10 +142,6 @@ float PlayerTemplate_GetDefaultFloatValue(string variable)
                {
                        return 1;
                }
-               case "num_random_start_weapons":
-               {
-                       return 0;
-               }
                case "attack_scale":
                case "defense_scale":
                {
@@ -158,8 +163,11 @@ string PlayerTemplate_GetDefaultStringValue(string variable)
 {
        switch (variable)
        {
-               case "start_weapons":
                case "random_start_weapons":
+               {
+                       cvar_string(PlayerTemplate_GetDefaultCvarName(variable));
+               }
+               case "start_weapons":
                {
                        return "";
                }
@@ -330,7 +338,8 @@ void PlayerTemplate_PlayerSpawn(entity player, string template)
        if (!warmup_stage)
        {
                GivePlayerRandomWeapons(player,
-                       PlayerTemplate_GetFloatValue(template, "num_random_start_weapons"),
+                       PlayerTemplate_GetFloatValue(template,
+                       "random_start_weapons_count"),
                        PlayerTemplate_GetStringValue(template, "random_start_weapons"),
                        PlayerTemplate_GetFloatValue(template, "random_start_shells"),
                        PlayerTemplate_GetFloatValue(template, "random_start_bullets"),