From a28095aec0ce627d2d1ffb6fcdf573b4d5ea8166 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Thu, 26 Oct 2017 12:03:49 +0300 Subject: [PATCH] reinstantiated hackfix for "bone bone" --- src/game/item.cpp | 4 +--- src/game/item.h | 4 ++-- src/game/object.cpp | 5 ++--- src/game/object.h | 1 + 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/game/item.cpp b/src/game/item.cpp index eba4a9a..5611978 100644 --- a/src/game/item.cpp +++ b/src/game/item.cpp @@ -429,12 +429,10 @@ void item::Initialize (int NewConfig, int SpecialFlags) { truth item::ShowMaterial () const { if (GetMainMaterialConfig().Size == 1) return GetMainMaterial()->GetConfig() != GetMainMaterialConfig()[0]; //FIXME: gum solution - /* - if (IsABone()) { + if (GetNameSingular() == "bone") { // never show the material for 'bone bone' if (GetMainMaterial()->GetConfig() == BONE) return false; } - */ return true; } diff --git a/src/game/item.h b/src/game/item.h index 289278b..502e07c 100644 --- a/src/game/item.h +++ b/src/game/item.h @@ -93,8 +93,6 @@ struct itemdatabase : public databasebase truth AllowRandomInstantiation() const; void PostProcess() { } - //virtual truth IsABone () const { return NameSingular == "bone"; } // gum solution - const prototype* ProtoType; /* Maintained by configcontainer */ sLong PartialPossibilitySum; @@ -640,6 +638,8 @@ class item : public object virtual truth AllowDetailedDescription () const { return false; } + virtual truth IsBoneNameSingular () const override { return (GetNameSingular() == "bone"); } + protected: virtual cchar* GetBreakVerb() const; virtual sLong GetMaterialPrice() const; diff --git a/src/game/object.cpp b/src/game/object.cpp index 47fa3f7..172b2fa 100644 --- a/src/game/object.cpp +++ b/src/game/object.cpp @@ -302,18 +302,17 @@ truth object::AddRustLevelDescription (festring &String, truth Articled) const { truth object::AddMaterialDescription (festring &String, truth Articled) const { //FIXME: gum solution - /*if (IsABone()) { + if (IsBoneNameSingular()) { //FIXME: 'bone bone' removing festring s(MainMaterial->GetName(Articled)); festring::sizetype pos = s.FindLast("bone"); - // if (pos != festring::NPos && pos == s.GetSize()-4) { while (pos > 0 && s[pos-1] == ' ') --pos; s.Erase(pos, s.GetSize()-pos); if (s.GetSize() == 0) return true; // no name left } String << s; - } else*/ { + } else { MainMaterial->AddName(String, Articled); } String << ' '; diff --git a/src/game/object.h b/src/game/object.h index 884de0e..fa1c4be 100644 --- a/src/game/object.h +++ b/src/game/object.h @@ -111,6 +111,7 @@ protected: //public: //virtual truth IsABone () const { return false; } //virtual truth IsASkull () const { return false; } + virtual truth IsBoneNameSingular () const { return false; } protected: festring mDefFile; -- 2.11.4.GIT