mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
fix gui.alert
This commit is contained in:
parent
9443892406
commit
b12982655d
4 changed files with 37 additions and 16 deletions
|
|
@ -22,6 +22,9 @@ namespace lua {
|
|||
|
||||
inline void pop(lua::State* L, int n = 1) {
|
||||
#ifndef NDEBUG
|
||||
if (n < 0) {
|
||||
abort();
|
||||
}
|
||||
if (lua_gettop(L) < n) {
|
||||
abort();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,10 @@ public:
|
|||
}
|
||||
|
||||
void update() override {
|
||||
if (lua::getglobal(L, "__vc_resume_coroutine")) {
|
||||
if (id == 0) {
|
||||
return;
|
||||
}
|
||||
if (lua::requireglobal(L, "__vc_resume_coroutine")) {
|
||||
lua::pushinteger(L, id);
|
||||
if (lua::call(L, 1)) {
|
||||
alive = lua::toboolean(L, -1);
|
||||
|
|
@ -102,10 +105,10 @@ public:
|
|||
}
|
||||
|
||||
void terminate() override {
|
||||
if (lua::getglobal(L, "__vc_stop_coroutine")) {
|
||||
lua::pushinteger(L, id);
|
||||
lua::pop(L, lua::call(L, 1));
|
||||
}
|
||||
lua::requireglobal(L, "__vc_stop_coroutine");
|
||||
lua::pushinteger(L, id);
|
||||
lua::pop(L, lua::call(L, 1));
|
||||
id = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue