- let cheats only give weapons in weapon slots.

This avoids problems which replace the entire arsenal and don't want the original weapons in there.
This commit is contained in:
Christoph Oelckers 2015-04-28 22:05:43 +02:00
parent a93c30238b
commit 319671b54a

View file

@ -768,11 +768,8 @@ void cht_Give (player_t *player, const char *name, int amount)
type->GetReplacement()->IsDescendantOf(RUNTIME_CLASS(ADehackedPickup))))
{
// Give the weapon only if it belongs to the current game or
// is in a weapon slot.
if (type->ActorInfo->GameFilter == GAME_Any ||
(type->ActorInfo->GameFilter & gameinfo.gametype) ||
player->weapons.LocateWeapon(type, NULL, NULL))
// Give the weapon only if it is in a weapon slot.
if (player->weapons.LocateWeapon(type, NULL, NULL))
{
AWeapon *def = (AWeapon*)GetDefaultByType (type);
if (giveall == ALL_YESYES || !(def->WeaponFlags & WIF_CHEATNOTWEAPON))