mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- 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:
parent
a93c30238b
commit
319671b54a
1 changed files with 2 additions and 5 deletions
|
@ -768,11 +768,8 @@ void cht_Give (player_t *player, const char *name, int amount)
|
||||||
type->GetReplacement()->IsDescendantOf(RUNTIME_CLASS(ADehackedPickup))))
|
type->GetReplacement()->IsDescendantOf(RUNTIME_CLASS(ADehackedPickup))))
|
||||||
|
|
||||||
{
|
{
|
||||||
// Give the weapon only if it belongs to the current game or
|
// Give the weapon only if it is in a weapon slot.
|
||||||
// is in a weapon slot.
|
if (player->weapons.LocateWeapon(type, NULL, NULL))
|
||||||
if (type->ActorInfo->GameFilter == GAME_Any ||
|
|
||||||
(type->ActorInfo->GameFilter & gameinfo.gametype) ||
|
|
||||||
player->weapons.LocateWeapon(type, NULL, NULL))
|
|
||||||
{
|
{
|
||||||
AWeapon *def = (AWeapon*)GetDefaultByType (type);
|
AWeapon *def = (AWeapon*)GetDefaultByType (type);
|
||||||
if (giveall == ALL_YESYES || !(def->WeaponFlags & WIF_CHEATNOTWEAPON))
|
if (giveall == ALL_YESYES || !(def->WeaponFlags & WIF_CHEATNOTWEAPON))
|
||||||
|
|
Loading…
Reference in a new issue