添加getEntityAllEffects接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "Global.h"
|
||||
#include <regex>
|
||||
#include <vector>
|
||||
|
||||
bool isInteger(const std::string& str) {
|
||||
std::regex pattern("^[+-]?\\d+$");
|
||||
@@ -935,6 +936,14 @@ void Export_Compatibility_API() {
|
||||
RemoteCall::exportAs("GMLIB_API", "entityHasEffect", [](Actor* entity, int effectId) -> int {
|
||||
return entity->hasEffect(*MobEffect::getById(effectId));
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getEntityAllEffects", [](Actor* entity) -> std::vector<int> {
|
||||
auto effects = entity->getAllEffects();
|
||||
std::vector<int> results = {};
|
||||
for (auto effect : effects) {
|
||||
results.push_back((int)effect.mId);
|
||||
}
|
||||
return results;
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getGameDifficulty", []() -> int {
|
||||
if (auto level = ll::service::getLevel()) {
|
||||
return (int)level->getDifficulty();
|
||||
|
||||
Reference in New Issue
Block a user