示例#1
0
文件: Perso.cs 项目: Zax37/raymap
        public void Write(Writer writer)
        {
            PersoBehaviour persoBehaviour = gao.GetComponent <PersoBehaviour>();

            if (p3dData != null && persoBehaviour != null && persoBehaviour.state != null && persoBehaviour.state.offset != null)
            {
                if (persoBehaviour.state.offset != p3dData.off_stateCurrent)
                {
                    p3dData.off_stateCurrent = persoBehaviour.state.offset;
                    Pointer.Goto(ref writer, p3dData.offset);
                    p3dData.Write(writer);
                } /*else {
                   * MapLoader.Loader.print("do not write state for perso " + fullName);
                   * }*/
            }

            if (persoBehaviour.clearTheBrain)
            {
                Pointer.Goto(ref writer, this.offset + 0xC); // perso + 0xC = Brain *
                Pointer.Write(writer, null);
                persoBehaviour.clearTheBrain = false;
            }

            CustomBitsComponent customBits = gao.GetComponent <CustomBitsComponent>();

            if (customBits != null && customBits.modified && stdGame != null)
            {
                Pointer.Goto(ref writer, stdGame.offset);
                stdGame.Write(writer);
            }
        }
示例#2
0
        public void Write(Writer writer)
        {
            PersoBehaviour persoBehaviour = gao.GetComponent <PersoBehaviour>();

            if (p3dData != null && persoBehaviour != null && persoBehaviour.state != null && persoBehaviour.state.offset != null)
            {
                if (persoBehaviour.state.offset != p3dData.off_stateCurrent)
                {
                    p3dData.off_stateCurrent = persoBehaviour.state.offset;
                    p3dData.Write(writer);
                } /*else {
                   * MapLoader.Loader.print("do not write state for perso " + fullName);
                   * }*/
            }

            if (persoBehaviour.clearTheBrain)
            {
                if (Settings.s.engineVersion == Settings.EngineVersion.Montreal)
                {
                    Pointer.Goto(ref writer, offset + 0x10);
                }
                else
                {
                    Pointer.Goto(ref writer, offset + 0xC);
                }
                Pointer.Write(writer, null);
                persoBehaviour.clearTheBrain = false;
            }

            CustomBitsComponent customBits = gao.GetComponent <CustomBitsComponent>();

            if (customBits != null && customBits.modified && stdGame != null)
            {
                stdGame.Write(writer);
            }
        }