Update StarPlayerLuaBindings.cpp

This commit is contained in:
Kae 2024-10-25 11:59:33 +11:00
parent c2b9f5ac07
commit 42a648ecc1

View File

@ -484,6 +484,13 @@ LuaCallbacks LuaBindings::makePlayerCallbacks(Player* player) {
return {}; return {};
}); });
callbacks.registerCallback("questState", [player](String const& questId) -> Maybe<String> {
if (auto quest = player->questManager()->getQuest(questId))
return QuestStateNames.getRight(quest->state());
return {};
});
callbacks.registerCallback("callQuest", [player](String const& questId, String const& func, LuaVariadic<LuaValue> const& args) -> Maybe<LuaValue> { callbacks.registerCallback("callQuest", [player](String const& questId, String const& func, LuaVariadic<LuaValue> const& args) -> Maybe<LuaValue> {
if (auto quest = player->questManager()->getQuest(questId)) if (auto quest = player->questManager()->getQuest(questId))
return quest->callScript(func, args); return quest->callScript(func, args);