Fix flyrange bug

This commit is contained in:
oc 2018-05-15 00:02:35 +08:00
parent 85958867b4
commit 0517e0f145
3 changed files with 45 additions and 5 deletions

View File

@ -1,8 +1,47 @@
(function () { (function () {
fs = {}; fs = {};
var _http = function (type, url, formData, success, error, mimeType, responseType) {
var xhr = new XMLHttpRequest();
xhr.open(type, url, true);
if (core.isset(mimeType))
xhr.overrideMimeType(mimeType);
if (core.isset(responseType))
xhr.responseType = responseType;
xhr.onload = function(e) {
if (xhr.status==200) {
if (core.isset(success)) {
success(xhr.response);
}
}
else {
if (core.isset(error))
error("HTTP "+xhr.status);
}
};
xhr.onabort = function () {
if (core.isset(error))
error("Abort");
}
xhr.ontimeout = function() {
if (core.isset(error))
error("Timeout");
}
xhr.onerror = function() {
if (core.isset(error))
error("Error on Connection");
}
if (core.isset(formData))
xhr.send(formData);
else xhr.send();
}
var postsomething = function (data, _ip, callback) { var postsomething = function (data, _ip, callback) {
if (typeof(data) == typeof([][0]) || data == null) data = JSON.stringify({1: 2}); if (typeof(data) == typeof([][0]) || data == null) data = JSON.stringify({1: 2});
core.http("POST", _ip, data, function (data) {
_http("POST", _ip, data, function (data) {
if (data.slice(0, 6) == 'error:') { if (data.slice(0, 6) == 'error:') {
callback(data, null); callback(data, null);
} }

View File

@ -1033,10 +1033,10 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback
} }
} }
if (core.status.maps[floorId].canFlyTo && core.status.hero.flyRange.indexOf(floorId)<0) { if (core.status.maps[floorId].canFlyTo && core.status.hero.flyRange.indexOf(floorId)<0) {
if (core.floorIds.indexOf(floorId)>core.floorIds.indexOf(core.status.floorId)) core.status.hero.flyRange.push(floorId);
core.status.hero.flyRange.push(floorId); core.status.hero.flyRange.sort(function (a, b) {
else return core.floorIds.indexOf(a) - core.floorIds.indexOf(b);
core.status.hero.flyRange.unshift(floorId); })
} }
window.setTimeout(function () { window.setTimeout(function () {

View File

@ -11,6 +11,7 @@
增添自定义装备的教程(个性化-自定义装备) √ 增添自定义装备的教程(个性化-自定义装备) √
重写教程的快速上手 √ 重写教程的快速上手 √
修复转向触发事件的朝向Bug √ 修复转向触发事件的朝向Bug √
修复flyRange的顺序问题 √
部分细节优化 √ 部分细节优化 √
----------------------------------------------------------------------- -----------------------------------------------------------------------