更新获取属性

This commit is contained in:
Lenheart 2025-12-12 00:25:48 +08:00
parent e1407d010f
commit 80694fa19f
1 changed files with 12 additions and 10 deletions

View File

@ -376,10 +376,10 @@ function Rindro_GetEquAddr(addr) {
} }
//本地模式 //本地模式
if(!getroottable().rawin("RINDROLOCAL"))RINDROLOCAL <- false; if (!getroottable().rawin("RINDROLOCAL")) RINDROLOCAL <- false;
function deepcopy(obj) { function deepcopy(obj) {
local copies = {}; // 用于跟踪已拷贝对象的表 local copies = {}; // 用于跟踪已拷贝对象的表
return _deepcopy(obj, copies); return _deepcopy(obj, copies);
} }
@ -400,15 +400,14 @@ function _deepcopy(obj, copies) {
local newObj; local newObj;
if (type == "array") { if (type == "array") {
newObj = array(obj.len()); newObj = array(obj.len());
copies[obj] <- newObj; // 在拷贝前记录 copies[obj] <- newObj; // 在拷贝前记录
for (local i = 0; i < obj.len(); i++) { for (local i = 0; i< obj.len(); i++) {
newObj[i] = _deepcopy(obj[i], copies); newObj[i] = _deepcopy(obj[i], copies);
} }
} } else if (type == "table") {
else if (type == "table") {
newObj = {}; newObj = {};
copies[obj] <- newObj; // 在拷贝前记录 copies[obj] <- newObj; // 在拷贝前记录
foreach(key, val in obj) { foreach(key, val in obj) {
// 键也需要深拷贝 // 键也需要深拷贝
@ -416,8 +415,7 @@ function _deepcopy(obj, copies) {
local newVal = _deepcopy(val, copies); local newVal = _deepcopy(val, copies);
newObj[newKey] <- newVal; newObj[newKey] <- newVal;
} }
} } else { // 类和实例(浅拷贝)
else { // 类和实例(浅拷贝)
newObj = obj; newObj = obj;
copies[obj] <- newObj; copies[obj] <- newObj;
} }
@ -425,6 +423,10 @@ function _deepcopy(obj, copies) {
return newObj; return newObj;
} }
function sq_GetCharacterAttribute(address){ function sq_GetCharacterAttribute(address) {
return L_sq_GetCharacterAttribute(address); return L_sq_GetCharacterAttribute(address);
}
function sq_GetCharacterEquipAttribute(offest, Slot) {
return L_sq_GetCharacterAttribute(offest, Slot);
} }