じ☆ve冰风 发表于 2026-7-26 07:48:57

Animation Save Bug Fix


Animation Save Bug Fix



         



Introduction
        This is a quick fix requisited by RHachicho, the plugin fixes fixes the bug that turns impossible to save the game while an event running in parallel mode is playing an animation on itself.
         
How to use
        Save the plugin in a .js and move it to js/plugins folder.



Plugin Code


//=============================================================================
// Animation Save Bug Fix (v1.2)
// by Fogomax
//=============================================================================

/*:
* @author Fogomax
* @plugindesc This plugin fixes the bug that turns impossible to save the game
* while an event running in parallel mode is playing an animation on itself.
*
* @help
* ===========================================================================
* » Description
* ===========================================================================
*
* This plugin fixes the bug that turns impossible to save the game while
* an event running in parallel mode is playing an animation on itself.
*
* It is plug-and-play, no configuration is required. Place this plugin on
* the top of the plugin list.
*
* ===========================================================================
* » License
* ===========================================================================
* WTFPL – Do What the frick You Want to Public License
* http://www.wtfpl.net/txt/copying/
*/

(function() {
        'use strict';

        //-----------------------------------------------------------------------------
        // DataManager
        //

        var _DataManager_makeSaveContents = DataManager.makeSaveContents;

        DataManager.makeSaveContents = function() {
                var contents = _DataManager_makeSaveContents.call(this);
                if (contents.map) {
                        var events = contents.map._events;
                        this.resolveCircularReference(events);
                }
                return contents;
        };

        DataManager.resolveCircularReference = function(events) {
                for (var i = 0; i < events.length; i++) {
                        if (!events) continue;
                        if (events._interpreter && events._interpreter._character === events) {
                                events._interpreter._character = null;
                        }
                }
        };

})();


Github:https://github.com/rafaelalmeidatk/JGSS/blob/master/AnimationSaveBugFix.js


Changelog


        v1.2 - Fixed some typos


        v1.1 - Changed the fix to DataManager.makeSaveContents method instead of Scene_Map.prototype.terminate


        v1.0 - Creation of the plugin



Usage
        This plugin is free for both commercial and non-commercial projects, no credits required.






         




本贴来自国际rpgmaker官方论坛作者:Fogomax处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/animation-save-bug-fix.73622/
页: [1]
查看完整版本: Animation Save Bug Fix