[ScriptError]: Use dvar in runtime error internal (#723)

This commit is contained in:
Edo 2023-01-16 23:32:00 +00:00 committed by GitHub
parent 899caeb357
commit 341ee49b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 10 deletions

View File

@ -7,8 +7,8 @@ namespace Components
int Elevators::PM_CorrectAllSolid(Game::pmove_s* pm, Game::pml_t* pml, Game::trace_t* trace)
{
assert(pm != nullptr);
assert(pm->ps != nullptr);
assert(pm);
assert(pm->ps);
Game::vec3_t point;
auto* ps = pm->ps;

View File

@ -563,8 +563,7 @@ namespace Components
{
Friends::LoggedOn = false;
if (Dedicated::IsEnabled() || ZoneBuilder::IsEnabled())
return;
if (Dedicated::IsEnabled() || ZoneBuilder::IsEnabled()) return;
Friends::UIStreamFriendly = Dvar::Register<bool>("ui_streamFriendly", false, Game::DVAR_ARCHIVE, "Stream friendly UI");
Friends::CLAnonymous = Dvar::Register<bool>("cl_anonymous", false, Game::DVAR_ARCHIVE, "Enable invisible mode for Steam");

View File

@ -403,7 +403,7 @@ namespace Components
if (!developer_)
{
assert(Scr_IsInOpcodeMemory(codePos));
if (!Game::scrVmPub->terminal_error)
if (!(*Game::com_developer)->current.enabled)
{
return;
}
@ -845,10 +845,10 @@ namespace Components
return filePosId;
}
void ScriptError::Scr_Settings_Hk(int developer, int developer_script, int abort_on_error)
void ScriptError::Scr_Settings_Hk([[maybe_unused]] int developer, int developer_script, int abort_on_error)
{
assert(!abort_on_error || developer);
developer_ = developer != 0;
developer_ = (*Game::com_developer)->current.enabled;
Game::scrVarPub->developer_script = developer_script != 0;
Game::scrVmPub->abort_on_error = abort_on_error != 0;
}

View File

@ -1993,7 +1993,9 @@ namespace Components
Command::Add("togglescores", Scores_Toggle_f);
if (Dedicated::IsEnabled())
{
return;
}
// Gamepad on frame hook
Utils::Hook(0x475E9E, IN_Frame_Hk, HOOK_CALL).install()->quick();

View File

@ -18,7 +18,7 @@ namespace Components
if (*Game::s_havePlaylists) return;
// Don't load playlists when dedi and no party
if (Dedicated::IsEnabled() && !Dvar::Var("party_enable").get<bool>())
if (Dedicated::IsEnabled() && !Party::IsEnabled())
{
*Game::s_havePlaylists = true;
Dvar::Var("xblive_privateserver").set(true);

View File

@ -429,7 +429,7 @@ namespace Components
// vid_restart when ingame
Utils::Hook::Nop(0x4CA1FA, 6);
// Filter log (initially com_logFilter, but I don't see why that dvar is needed)
// Filter log (initially com_logFilter, but I don't see why that dvar print is needed)
// Seems like it's needed for B3, so there is a separate handling for dedicated servers in Dedicated.cpp
if (!Dedicated::IsEnabled())
{

View File

@ -422,7 +422,7 @@ namespace Components
// Feeder
UIFeeder::Add(10.0f, GetDemoCount, GetDemoText, SelectDemo);
// set the configstrings stuff to load the default (empty) string table; this should allow demo recording on all gametypes/maps
// Set the configstrings stuff to load the default (empty) string table; this should allow demo recording on all gametypes/maps
if (!Dedicated::IsEnabled()) Utils::Hook::Set<const char*>(0x47440B, "mp/defaultStringTable.csv");
// Change font size