]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed bad merged vote.qc and stabilizing old inventory.qh
authorLegendaryGuard <rootuser999@gmail.com>
Sat, 13 Feb 2021 20:17:24 +0000 (21:17 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Sat, 13 Feb 2021 20:17:24 +0000 (21:17 +0100)
qcsrc/common/items/inventory.qh
qcsrc/server/command/vote.qc

index 62df6330e57c148f05302d6da66e05b4db9f11aa..ec435f988d210d9ce8aff5d5d7c6c18473952d63 100644 (file)
@@ -181,16 +181,6 @@ void Inventory_clear(entity store)
     });
 }
 
-void Inventory_ClearAll() {
-       FOREACH_CLIENT(IS_PLAYER(it), {
-               entity store = PS(it);          
-               FOREACH(Items, true, {
-                       store.inventory.inv_items[it.m_id] = 0;
-               });
-        Inventory_update(store);
-       });
-}
-
 void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; }
 void InventoryStorage_delete(entity e) { delete(e.inventory_store); }
 #endif
index 9f53858a66c78dc6455daa908f61b725d5d9ec25..34daa512b6f984d5f568fd92a4a81c36e86c23e9 100644 (file)
@@ -221,7 +221,7 @@ void VoteCount(float first_count)
                // z411
                if(vote_target_type == VOTE_TARGET_TEAM && it.team != vote_caller.team) continue;
                if(vote_target_type == VOTE_TARGET_SINGLE && it != vote_target) continue;
-               
+
                ++vote_player_count;
                if (IS_PLAYER(it))   ++vote_real_player_count;
                switch (it.vote_selection)
@@ -423,7 +423,6 @@ void ReadyRestart_think(entity this)
        restart_mapalreadyrestarted = true;
        reset_map(true);
        Score_ClearAll();
-       Inventory_ClearAll();
        delete(this);
 }
 
@@ -461,10 +460,7 @@ void ReadyRestart_force()
        warmup_stage = 0;                // once the game is restarted the game is in match stage
 
        // reset the .ready status of all players (also spectators)
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
-               it.ready = false;
-               Kill_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CPID_MISSING_READY);
-       });
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), { it.ready = false; });
        readycount = 0;
        Nagger_ReadyCounted();  // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
 
@@ -489,7 +485,6 @@ void ReadyRestart_force()
                FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
        }
 
-       round_handler_Activate(true);
        if (!sv_ready_restart_after_countdown) reset_map(true);
        if (autocvar_sv_eventlog) GameLogEcho(":restart");
 }
@@ -501,10 +496,7 @@ void ReadyRestart()
 
        // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
        // Otherwise scores could be manipulated during the countdown.
-       if (!sv_ready_restart_after_countdown) {
-               Score_ClearAll();
-               Inventory_ClearAll();
-       }
+       if (!sv_ready_restart_after_countdown) Score_ClearAll();
        ReadyRestart_force();
 }
 
@@ -706,8 +698,6 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa
                case MUT_VOTEPARSE_UNACCEPTABLE: { return 0; }
        }
 
-       vote_target_type = VOTE_TARGET_ALL;
-       
        switch (first_command) // now go through and parse the proper commands to adjust as needed.
        {
                case "kick":
@@ -726,7 +716,7 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa
                                if (first_command == "kickban")
                                        command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~");
 
-                               vote_parsed_command = strcat("defer 2 ", first_command, " # ", ftos(etof(victim)), " ", command_arguments);
+                               vote_parsed_command = strcat(first_command, " # ", ftos(etof(victim)), " ", command_arguments);
                                vote_parsed_display = sprintf("^1%s #%d ^7%s^1 %s", first_command, etof(victim), victim.netname, reason);
                        }
                        else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return 0; }
@@ -740,12 +730,12 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa
                {
                        vote_command = ValidateMap(argv(startpos + 1), caller);
                        if (!vote_command)  return -1;
-                       vote_parsed_command = strcat("defer 2 gotomap ", vote_command);
+                       vote_parsed_command = strcat("gotomap ", vote_command);
                        vote_parsed_display = strzone(strcat("^1", vote_parsed_command));
 
                        break;
                }
-               
+
                // z411 team calls
                case "teamname":
                {
@@ -790,13 +780,10 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa
                }
 
                case "restart":
-               case "shuffleteams":
-               case "allready":
-               case "endmatch":
                {
                        // add a delay so that vote result can be seen and announcer can be heard
                        // if the vote is accepted
-                       vote_parsed_command = strcat("defer 2 ", vote_command);
+                       vote_parsed_command = strcat("defer 1 ", vote_command);
                        vote_parsed_display = strzone(strcat("^1", vote_command));
 
                        break;