Resolved merge conflicts. #17

Open
anomaly wants to merge 15 commits from anomaly/iw6-mod:master into master
5 changed files with 27 additions and 0 deletions
Showing only changes of commit d76f41deb9 - Show all commits

View File

@ -5,6 +5,7 @@
#include "game/dvars.hpp"
#include "console.hpp"
#include "demo_playback.hpp"
#include <utils/hook.hpp>
#include <utils/string.hpp>
@ -13,6 +14,12 @@ namespace dvar_cheats
{
void apply_sv_cheats(const game::dvar_t* dvar, const game::DvarSetSource source, game::dvar_value* value)
{
// return early because sv_cheats is enabled when playing back demos
if (demo_playback::playing())
{
return;
}
if (dvar && dvar->name == "sv_cheats"s)
{
// if dedi, do not allow internal to change value so servers can allow cheats if they want to

View File

@ -1,5 +1,6 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "fps.hpp"
#include "scheduler.hpp"
#include "game/game.hpp"
@ -173,6 +174,11 @@ namespace fps
}
}
float get_avg_fps()
{
return 1000.0f / (cg_perf.average + std::numeric_limits<float>::epsilon());
}
class component final : public component_interface
{
public:

View File

@ -0,0 +1,6 @@
#pragma once
namespace fps
{
[[nodiscard]] float get_avg_fps();
}

View File

@ -83,6 +83,12 @@ namespace party
});
}
void connect_to_dummy_party(const std::string& mapname, const std::string& gametype)
{
const game::netadr_t dummy_target{};
connect_to_party(dummy_target, mapname, gametype);
}
void switch_gamemode_if_necessary(const std::string& gametype)
{
const auto target_mode = gametype == "aliens" ? game::CODPLAYMODE_ALIENS : game::CODPLAYMODE_CORE;

View File

@ -2,6 +2,8 @@
namespace party
{
void connect_to_dummy_party(const std::string& mapname, const std::string& gametype);
void switch_gamemode_if_necessary(const std::string& gametype);
void perform_game_initialization();