GenieClient / Genie4

.NET 6 Update of Genie
GNU General Public License v3.0
20 stars 14 forks source link

subs doubling subs in areas where <preset> is going on #105

Closed Thires closed 2 years ago

Thires commented 2 years ago

it is causing the sub to double when using in for example #sub {(Thires)} {$1 (test)} will result in this Thires (test) (test) whispers, "hello" Thires (test) (test) says, "Test."

instead of Thires (test) says, "Test."

Thires commented 2 years ago

did some testing commenting out sTmp = ParseSubstitutions(sTmp); in game.cs

                            if (buffer.EndsWith("</preset>"))
                            {
                                XmlDocument presetXML = new XmlDocument();
                                presetXML.LoadXml(buffer);

                                string presetLabel = GetAttributeData(presetXML.FirstChild, "id").ToLower();
                                switch(presetLabel)
                                {
                                    case "whisper":
                                        presetLabel = "whispers";
                                        break;

                                    case "thought":
                                        presetLabel = "thoughts";
                                        break;

                                    default:
                                        break;
                                }
                                //sTmp = ParseSubstitutions(sTmp);
                                m_oGlobals.VolatileHighlights.Add(new System.Collections.Generic.KeyValuePair<string, string>(presetLabel, sTmp));
                                if(presetLabel == "roomdesc")
                                {
                                    PrintTextWithParse(sTmp, bIsPrompt: false, oWindowTarget: 0);
                                    sTmp = string.Empty;
                                }

corrected/stopped it from occurring