diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-05-29 22:52:10 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-05-29 22:52:10 -0300 |
| commit | f6c8c67094de3fe19f1e7871a7e78a91fb9bf3dd (patch) | |
| tree | 16d4bf88e2a3cc37a160d768fa26b82390796cb7 /src/objects.cc | |
| parent | e5b60ae075e571a29868993a5f0d191d91f8d266 (diff) | |
| download | game-f6c8c67094de3fe19f1e7871a7e78a91fb9bf3dd.tar.gz game-f6c8c67094de3fe19f1e7871a7e78a91fb9bf3dd.zip | |
finish `strings.cc` impl
Diffstat (limited to 'src/objects.cc')
| -rw-r--r-- | src/objects.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/objects.cc b/src/objects.cc index e6903cd..f617fb9 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -321,21 +321,13 @@ const char *ObjectType::getName(int Count){ return NULL; } - // TODO(fusion): This is yet another rabbit hole. I'm not sure why we have - // the object name copied to the stack when `Plural` returns its own static - // buffer. -#if 0 - char ObjectName[50]; TObjectType *TypeP = ObjectTypes.at(this->TypeID); - if(Type->Name != NULL){ - strcpy(ObjectName, TypeP->Name); - }else{ - ObjectName[0] = 0; + const char *Name = TypeP->Name; + if(Name == NULL){ + Name = ""; } - return Plural(ObjectName, Count); -#endif - return "Unnamed"; + return Plural(Name, Count); } const char *ObjectType::getDescription(void){ |
