Skip to content
Permalink
Browse files

Misc Improvements (see description)

Renamed Semiauto Fire to Fullauto Fire
Fixed Semiauto Fire not working with a value of 1
Add rvar Migration
  • Loading branch information...
BenCat07 committed Sep 29, 2019
1 parent 92d8722 commit c7393d7f29a6e626500f3d9424993c366e546111
Showing with 20 additions and 5 deletions.
  1. +1 −1 data/menu/nullifiedcat/misc/collective.xml
  2. +3 −3 src/hooks/CreateMove.cpp
  3. +16 −1 src/settings/SettingsIO.cpp
@@ -16,7 +16,7 @@
<AutoVariable width="fill" target="misc.no-lerp" label="nolerp"/>
<AutoVariable width="fill" target="misc.no-push" label="nopush"/>
<AutoVariable width="fill" target="misc.roll-speedhack" label="Moonwalk"/>
<AutoVariable width="fill" target="misc.semi-auto" label="Semiauto Fire"/>
<AutoVariable width="fill" target="misc.full-auto" label="Fully Automated Firing"/>
<AutoVariable width="fill" target="misc.show-spectators" label="Show spectators"/>
<LabeledObject width="fill" label="Skybox Override">
<Select target="misc.skybox-override">
@@ -25,7 +25,7 @@ static settings::Boolean roll_speedhack{ "misc.roll-speedhack", "false" };
static settings::Boolean forward_speedhack{ "misc.roll-speedhack.forward", "false" };
static settings::Boolean engine_pred{ "misc.engine-prediction", "true" };
static settings::Boolean debug_projectiles{ "debug.projectiles", "false" };
static settings::Int semiauto{ "misc.semi-auto", "0" };
static settings::Int fullauto{ "misc.full-auto", "0" };
static settings::Int fakelag_amount{ "misc.fakelag", "0" };
static settings::Boolean fuckmode{ "misc.fuckmode", "false" };

@@ -287,9 +287,9 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
++attackticks;
else
attackticks = 0;
if (semiauto)
if (fullauto)
if (current_user_cmd->buttons & IN_ATTACK)
if (attackticks % *semiauto < *semiauto - 1)
if (attackticks % *fullauto + 1 < *fullauto)
current_user_cmd->buttons &= ~IN_ATTACK;
static int fakelag_queue = 0;
if (CE_GOOD(LOCAL_E))
@@ -148,7 +148,6 @@ void settings::SettingsReader::pushChar(char c)
}
else
{

was_non_space = true;
}

@@ -186,6 +185,17 @@ void settings::SettingsReader::pushChar(char c)
}
}

struct migration_struct
{
const std::string from;
const std::string to;
};
/* clang-format off */
// Use one per line, from -> to
static std::array<migration_struct, 1> migrations = {
{ "misc.semi-auto", "misc.full-auto" }
};
/* clang-format on */
void settings::SettingsReader::finishString(bool complete)
{
if (complete && reading_key)
@@ -199,6 +209,11 @@ void settings::SettingsReader::finishString(bool complete)
if (reading_key)
{
stored_key = std::move(str);
for (auto &migration : migrations)
{
if (stored_key == migration.from)
stored_key = migration.to;
}
}
else
{

0 comments on commit c7393d7

Please sign in to comment.
You can’t perform that action at this time.