From cd6b26da5db7ef5422b510ba141ab924aaec71bf Mon Sep 17 00:00:00 2001 From: fusion32 Date: Mon, 2 Feb 2026 22:00:39 -0300 Subject: minor tweaks --- src/map.cc | 2 +- src/moveuse.cc | 3 +-- src/objects.cc | 7 ++++--- src/strings.cc | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/map.cc b/src/map.cc index 7312993..61cae98 100644 --- a/src/map.cc +++ b/src/map.cc @@ -2187,7 +2187,7 @@ Object CopyObject(Object Con, Object Source){ uint32 Editor = NewObj.getAttribute(EDITOR); if(Editor != 0){ - Editor = AddDynamicString(GetDynamicString(TextString)); + Editor = AddDynamicString(GetDynamicString(Editor)); NewObj.setAttribute(EDITOR, Editor); } } diff --git a/src/moveuse.cc b/src/moveuse.cc index bdf6565..0bf932c 100644 --- a/src/moveuse.cc +++ b/src/moveuse.cc @@ -721,7 +721,7 @@ void SendMail(Object Obj){ return; } - print(3,"Versende Post...\n"); + print(3, "Versende Post...\n"); uint32 TextAttr = 0; if(ObjType == GetSpecialObject(LETTER_NEW)){ @@ -748,7 +748,6 @@ void SendMail(Object Obj){ return; } - char Addressee[256]; char Town[256]; { diff --git a/src/objects.cc b/src/objects.cc index 18fe01c..9130fb2 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -281,8 +281,9 @@ uint32 ObjectType::getAttribute(TYPEATTRIBUTE Attribute){ int ObjectType::getAttributeOffset(INSTANCEATTRIBUTE Attribute){ if(!this->getFlag(InstanceAttributeFlags[Attribute])){ - // TODO(fusion): Review this? - if(Attribute != CONTENT || !this->getFlag(CHEST)){ + // NOTE(fusion): The CONTENT attribute seems to be the only one that maps + // to two object flags, which is why we have this extra check here. + if(!(Attribute == CONTENT && this->getFlag(CHEST))){ return -1; } } @@ -608,7 +609,7 @@ static void LoadConversionList(void){ // NOTE(fusion): Creature container. OldGroup[99] = 250; - OldNumber[00] = 0; + OldNumber[99] = 0; NewType[GetNewTypeIndex(250, 0)] = 99; } diff --git a/src/strings.cc b/src/strings.cc index 95471d6..41f9388 100644 --- a/src/strings.cc +++ b/src/strings.cc @@ -60,13 +60,13 @@ const char *AddStaticString(const char *String){ } uint32 AddDynamicString(const char *String){ - int StringLen = (int)strlen(String); - if((StringLen + 1) > DynamicBlockSize){ - error("AddDynamicString: String zu lang (%d)\n", StringLen); + int StringLen = (String ? (int)strlen(String) : 0); + if(StringLen == 0){ return 0; } - if(StringLen == 0){ + if((StringLen + 1) > DynamicBlockSize){ + error("AddDynamicString: String zu lang (%d)\n", StringLen); return 0; } -- cgit v1.2.3