Fix wrong flags getting checked for allowed weapons

This commit is contained in:
smallmodel 2025-02-03 20:43:03 +01:00
parent fb5ed82401
commit ad01c2d966
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -8845,25 +8845,25 @@ void Player::EnsurePlayerHasAllowedWeapons()
Q_strncpyz(client->pers.dm_primary, "smg", sizeof(client->pers.dm_primary));
} else if (!Q_stricmp(client->pers.dm_primary, "smg")) {
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
if (!(dmflags->integer & DF_WEAPON_NO_SMG)) {
return;
}
Q_strncpyz(client->pers.dm_primary, "mg", sizeof(client->pers.dm_primary));
} else if (!Q_stricmp(client->pers.dm_primary, "mg")) {
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
if (!(dmflags->integer & DF_WEAPON_NO_MG)) {
return;
}
Q_strncpyz(client->pers.dm_primary, "shotgun", sizeof(client->pers.dm_primary));
} else if (!Q_stricmp(client->pers.dm_primary, "shotgun")) {
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
if (!(dmflags->integer & DF_WEAPON_NO_SHOTGUN)) {
return;
}
Q_strncpyz(client->pers.dm_primary, "heavy", sizeof(client->pers.dm_primary));
} else if (!Q_stricmp(client->pers.dm_primary, "heavy")) {
if (!(dmflags->integer & DF_WEAPON_NO_RIFLE)) {
if (!(dmflags->integer & DF_WEAPON_NO_ROCKET)) {
return;
}