Skip to content

Commit

Permalink
Fix force event messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Oct 9, 2023
1 parent 8c6b0b9 commit 857c07c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions data/talkactions/scripts/force_event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ function onSay(player, words, param)
logCommand(player, words, param)

local returnValue = Game.startEvent(param)
if returnValue then
player:sendTextMessage(MESSAGE_INFO_DESCR, "Event started.")
else
if returnValue == nil then
player:sendTextMessage(MESSAGE_INFO_DESCR, "No such event exists.")
return false
end

player:sendTextMessage(MESSAGE_INFO_DESCR, "Event started.")
return returnValue
end
2 changes: 1 addition & 1 deletion src/luascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4989,7 +4989,7 @@ int LuaScriptInterface::luaGameStartEvent(lua_State* L)
if (auto it = eventMap.find(eventName); it != eventMap.end()) {
pushBoolean(L, it->second.executeEvent());
} else {
pushBoolean(L, false);
lua_pushnil(L);
}
return 1;
}
Expand Down

0 comments on commit 857c07c

Please sign in to comment.