- fixed autoaim check and adjusted presentation in the menu to be correct for all games.

Fixes #264
This commit is contained in:
Christoph Oelckers 2021-02-06 10:56:11 +01:00
parent ba22df2a2a
commit 5b6aa372ea
4 changed files with 12 additions and 3 deletions

View file

@ -120,6 +120,7 @@ enum
GAMEFLAG_PSEXHUMED = GAMEFLAG_POWERSLAVE | GAMEFLAG_EXHUMED, // the two games really are the same, except for the name and the publisher.
GAMEFLAG_WORLDTOUR = 0x00008000,
GAMEFLAG_DUKEDC = 0x00010000,
GAMEFLAG_DUKECOMPAT = GAMEFLAG_DUKE | GAMEFLAG_NAM | GAMEFLAG_NAPALM | GAMEFLAG_WW2GI | GAMEFLAG_RRALL,
GAMEFLAGMASK = 0x0000FFFF, // flags allowed from grpinfo
// We still need these for the parsers.

View file

@ -87,7 +87,8 @@ CVARD(Bool, cl_exhumedoldturn, false, CVAR_ARCHIVE, "enable/disable legacy turni
CUSTOM_CVARD(Int, cl_autoaim, 1, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable weapon autoaim")
{
if (self < 0 || self > (isBlood() ? 2 : 3)) self = 1; // The Shadow Warrior backend only has a bool for this.
int automodes = (g_gameType & (GAMEFLAG_DUKECOMPAT | GAMEFLAG_BLOOD)) ? 2 : 1;
if (self < 0 || self > automodes) self = 1;
};
CUSTOM_CVARD(Int, cl_weaponswitch, 3, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable auto weapon switching")

View file

@ -107,7 +107,7 @@ inline const char* PlayerName(int pindex)
return playername;
}
inline bool Autoaim(int player)
inline int Autoaim(int player)
{
// Todo: proper implementation of user CVARs.
return cl_autoaim;

View file

@ -944,7 +944,14 @@ OptionValue "WeapSwitch"
OptionMenu GameplayOptions protected
{
Title "$GMPLYMNU_TITLE"
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides, Blood)
{
Option "$PLYRMNU_AUTOAIM", "cl_autoaim", "AimMode"
}
else
{
Option "$PLYRMNU_AUTOAIM", "cl_autoaim", "OnOff"
}
Option "$PLYRMNU_ALWAYSRUN", "cl_autorun", "OnOff"
Option "$PLRMNU_RUNMODE", "cl_runmode", "RunMode"
ifgame(ShadowWarrior)