コード例 #1
0
        void SetGuide(GameClient client, bool sendRemove = true)
        {
            if (this.guide == client)
            {
                return;
            }

            if (this.guide != null)
            {
                this.guide.GuidedVobs.Remove(this.ID);
                if (sendRemove)
                {
                    Messages.WriteRemoveGuidable(this.guide, this);
                }
                if (this.currentCmd is TargetCmd)
                {
                    this.guide.RemoveGuideTarget(((TargetCmd)this.currentCmd).Target);
                }
            }

            if (client != null)
            {
                client.GuidedVobs.Add(this);
                Messages.WriteAddGuidable(client, this, this.currentCmd);
                if (this.currentCmd is TargetCmd)
                {
                    client.AddGuideTarget(((TargetCmd)this.currentCmd).Target);
                }
            }

            this.guide = client;

            /*if (guide == null || guide.Character == null)
             * {
             *  SetGuideCommand(null);
             * }
             * else
             * {
             *  SetGuideCommand(Scripting.ScriptManager.Interface.GetTestCmd(this.guide.Character));
             * }*/
        }