修复 XEquipment 参数 getter 的 M8-M10 缺陷
- M8 DEF_KEY_FUNC 返回值改为值初始化,键缺失或类型不符时不再返回栈上垃圾值 - M9 getter 内对 m_pXDataMap 判空,避免空 map 构造的 impl 直接崩溃 - M10 GetType 读取 KEY_TYPE 失败时输出日志,不再静默返回 0 - 两份 DEF_KEY_FUNC 定义(XEquipmentImpl.h 与 ParamEquImpl.h)同步修改
This commit is contained in:
1 parent
a51a550a99
commit
39634dc86a
3 files changed
+8
-5
No files matched your search
@@ -43,8 +43,9 @@ public:\
|
||||
static const CString key;\
|
||||
##type Get##key() const\
|
||||
{\
|
||||
type v;\
|
||||
m_pXDataMap->GetAt(key, v);\
|
||||
type v = type();\
|
||||
if (m_pXDataMap)\
|
||||
m_pXDataMap->GetAt(key, v);\
|
||||
return v;\
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user