mirror of https://github.com/zeldaret/botw.git
ksys/act: FIx Query loadBool, loadInt, loadFloat
This commit is contained in:
parent
4f2f4ede4f
commit
7d6938bc27
|
@ -82,6 +82,15 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
bool setAITreeVariable(const sead::SafeString& key, AIDefParamType type, const T& val) const {
|
||||||
|
auto* variable = static_cast<T*>(getAITreeVariablePointer(key, type, true));
|
||||||
|
if (!variable)
|
||||||
|
return false;
|
||||||
|
*variable = val;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool load(const Actor& actor, const ParamNameTypePairs& pairs, s32 count, sead::Heap* heap);
|
bool load(const Actor& actor, const ParamNameTypePairs& pairs, s32 count, sead::Heap* heap);
|
||||||
void* getAITreeVariablePointer(const sead::SafeString& key, AIDefParamType type,
|
void* getAITreeVariablePointer(const sead::SafeString& key, AIDefParamType type,
|
||||||
bool x = false) const;
|
bool x = false) const;
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool Query::loadInt(const evfl::ParamAccessor& accessor, const sead::SafeString&
|
||||||
if (!accessor.FindInt(&value, param.cstr()))
|
if (!accessor.FindInt(&value, param.cstr()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return mParamPack.setVariable(param, AIDefParamType::Int, value);
|
return mParamPack.setAITreeVariable(param, AIDefParamType::Int, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Query::loadFloat(const evfl::ParamAccessor& accessor, const sead::SafeString& param) {
|
bool Query::loadFloat(const evfl::ParamAccessor& accessor, const sead::SafeString& param) {
|
||||||
|
@ -92,7 +92,7 @@ bool Query::loadFloat(const evfl::ParamAccessor& accessor, const sead::SafeStrin
|
||||||
if (!accessor.FindFloat(&value, param.cstr()))
|
if (!accessor.FindFloat(&value, param.cstr()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return mParamPack.setVariable(param, AIDefParamType::Float, value);
|
return mParamPack.setAITreeVariable(param, AIDefParamType::Float, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Query::loadBool(const evfl::ParamAccessor& accessor, const sead::SafeString& param) {
|
bool Query::loadBool(const evfl::ParamAccessor& accessor, const sead::SafeString& param) {
|
||||||
|
@ -100,7 +100,7 @@ bool Query::loadBool(const evfl::ParamAccessor& accessor, const sead::SafeString
|
||||||
if (!accessor.FindBool(&value, param.cstr()))
|
if (!accessor.FindBool(&value, param.cstr()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return mParamPack.setVariable(param, AIDefParamType::Bool, value);
|
return mParamPack.setAITreeVariable(param, AIDefParamType::Bool, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Query::getAITreeVariable(sead::SafeString** value, const sead::SafeString& param) const {
|
bool Query::getAITreeVariable(sead::SafeString** value, const sead::SafeString& param) const {
|
||||||
|
|
Loading…
Reference in New Issue