HDB: Add cineStop() Lua function

This commit is contained in:
Nipun Garg 2019-06-24 02:46:26 +05:30 committed by Eugene Sandulenko
parent e46e8b45d8
commit d7cc3ab225
2 changed files with 11 additions and 2 deletions

View File

@ -415,7 +415,8 @@ void AI::cineStart(bool abortable, const char *abortFunc) {
void AI::cineStop(const char *funcNext) {
CineCommand *cmd = new CineCommand;
cmd->cmdType = C_STOPCINE;
strcpy(cmd->title, funcNext);
if (funcNext)
strcpy(cmd->title, funcNext);
_cine.push_back(cmd);
}

View File

@ -82,7 +82,15 @@ static int cineStart(lua_State *L) {
}
static int cineStop(lua_State *L) {
warning("STUB: STOP CINE");
const char *funcNext = NULL;
int stackTop = lua_gettop(L);
if (stackTop) {
funcNext = lua_tostring(L, 1);
lua_pop(L, 1);
}
g_hdb->_ai->cineStop(funcNext);
return 0;
}