fromLoad in afterChangeFloor

This commit is contained in:
oc 2018-08-28 23:22:13 +08:00
parent cac3154aa0
commit 2258fc90d0
2 changed files with 5 additions and 4 deletions

View File

@ -250,9 +250,9 @@ events.prototype.gameOver = function (ending, fromReplay, norank) {
} }
////// 转换楼层结束的事件 ////// ////// 转换楼层结束的事件 //////
events.prototype.afterChangeFloor = function (floorId) { events.prototype.afterChangeFloor = function (floorId, fromLoad) {
if (main.mode!='play') return; if (main.mode!='play') return;
return this.eventdata.afterChangeFloor(floorId); return this.eventdata.afterChangeFloor(floorId, fromLoad);
} }
////// 开始执行一系列自定义事件 ////// ////// 开始执行一系列自定义事件 //////
@ -1203,7 +1203,7 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback
var changed = function () { var changed = function () {
core.unLockControl(); core.unLockControl();
core.status.replay.animate=false; core.status.replay.animate=false;
core.events.afterChangeFloor(floorId); core.events.afterChangeFloor(floorId, fromLoad);
if (core.isset(callback)) callback(); if (core.isset(callback)) callback();
} }
if (displayAnimate) { if (displayAnimate) {

View File

@ -80,8 +80,9 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}) })
}, },
////// 转换楼层结束的事件 ////// ////// 转换楼层结束的事件 //////
"afterChangeFloor" : function (floorId) { "afterChangeFloor" : function (floorId, fromLoad) {
// 转换楼层结束的事件 // 转换楼层结束的事件
// floorId是切换到的楼层fromLoad若为true则代表是从读档行为造成的楼层切换
if (!core.hasFlag("visited_"+floorId)) { if (!core.hasFlag("visited_"+floorId)) {
core.insertAction(core.floors[floorId].firstArrive); core.insertAction(core.floors[floorId].firstArrive);
core.setFlag("visited_"+floorId, true); core.setFlag("visited_"+floorId, true);