Innoxia / liliths-throne-public

Public repository for Lilith's Throne. (18+)
Other
493 stars 434 forks source link

Brackets [] in room names #1770

Open DerMaskierte opened 1 year ago

DerMaskierte commented 1 year ago

Describe the bug Adding a pair of brackets to a room name will prevent room management screen from working on a room.

Expected behavior Brackets becoming part of the name of the room.

To Reproduce Go to Lilaya's house, visit a room, go to management, and rename it adding both opening and closing brackets [ ].
The bug will not happen if the brackets are placed in reverse order ][.

Attach files error.log

Additional information:

CognitiveMist commented 1 year ago

I can tell you why:

Square brackets are used to access the game's parser commands. For example, [npc.Name] will be replaced by the npc's name. An empty command, or any other invalid command, will cause an error. That said, the behavior when an error happens could probably be improved here. To use square brackets as a display symbol, the safest option is to use the HTML entity instead: &#91; will appear as [, and &#93; will appear as ]. Other bracket types, such as (), <>, or {} can be used normally.