From bdd1203aca48a35bf43cf3be578ed5f31f7e9205 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 Dec 2009 07:44:04 +0000 Subject: [PATCH] - Fixed: It was not possible to set the ammo type of a weapon explicitly to 'none'. SVN r2033 (trunk) --- docs/rh-log.txt | 4 ++++ src/thingdef/thingdef_properties.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ed7666230..0897f3eb9 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +December 19, 2009 (Changes by Graf Zahl) +- Fixed: It was not possible to set the ammo type of a weapon explicitly to + 'none'. + December 18, 2009 - A_FreezeDeath() now removes fuzz effects. - In mus2midi.cpp, added range checking to MUS_SYSEVENT and MUS_CTRLCHANGE, diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 6d9419f97..ea8407cc0 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -1421,7 +1421,8 @@ DEFINE_CLASS_PROPERTY(ammogive2, I, Weapon) DEFINE_CLASS_PROPERTY(ammotype, S, Weapon) { PROP_STRING_PARM(str, 0); - defaults->AmmoType1 = FindClassTentative(str, "Ammo"); + if (!stricmp(str, "none") || *str == 0) defaults->AmmoType1 = NULL; + else defaults->AmmoType1 = FindClassTentative(str, "Ammo"); } //========================================================================== @@ -1430,7 +1431,8 @@ DEFINE_CLASS_PROPERTY(ammotype, S, Weapon) DEFINE_CLASS_PROPERTY(ammotype1, S, Weapon) { PROP_STRING_PARM(str, 0); - defaults->AmmoType1 = FindClassTentative(str, "Ammo"); + if (!stricmp(str, "none") || *str == 0) defaults->AmmoType1 = NULL; + else defaults->AmmoType1 = FindClassTentative(str, "Ammo"); } //========================================================================== @@ -1439,7 +1441,8 @@ DEFINE_CLASS_PROPERTY(ammotype1, S, Weapon) DEFINE_CLASS_PROPERTY(ammotype2, S, Weapon) { PROP_STRING_PARM(str, 0); - defaults->AmmoType2 = FindClassTentative(str, "Ammo"); + if (!stricmp(str, "none") || *str == 0) defaults->AmmoType1 = NULL; + else defaults->AmmoType2 = FindClassTentative(str, "Ammo"); } //==========================================================================