diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index ff563ac..ff65463 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -5806,7 +5806,7 @@ Entity* Game::setActivePet(int flag) void Game::createLi() { - int liFlag = dsq->continuity.getFlag(1000); + int liFlag = dsq->continuity.getFlag(FLAG_LI); std::ostringstream os; os << "liFlag: " << liFlag; debugLog(os.str()); diff --git a/Aquaria/SceneEditor.cpp b/Aquaria/SceneEditor.cpp index e35557e..17d63e5 100644 --- a/Aquaria/SceneEditor.cpp +++ b/Aquaria/SceneEditor.cpp @@ -3370,9 +3370,12 @@ void SceneEditor::updateText() os << "entities (" << dsq->entities.size() << ")"; if (editingEntity) { - os << " id: " << editingEntity->getID() << " name: " << editingEntity->name << " flag: " << dsq->continuity.getEntityFlag(dsq->game->sceneName, editingEntity->getID()); - os << " groupID: " << editingEntity->getGroupID() << " "; - os << " state: " << editingEntity->getState(); + os << " id: " << editingEntity->getID() + << " name: " << editingEntity->name + << " flag:" << dsq->continuity.getEntityFlag(dsq->game->sceneName, editingEntity->getID()) + << " fh:" << editingEntity->isfh() + << " fv:" << editingEntity->isfv() + << " state:" << editingEntity->getState(); } break; case ET_PATHS: diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index d493110..3fe462c 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -3233,16 +3233,30 @@ luaFunc(entity_initStrands) luaFunc(entity_initSkeletal) { - ScriptedEntity *e = scriptedEntity(L); - e->renderQuad = false; - e->setWidthHeight(128, 128); - e->skeletalSprite.loadSkeletal(getString(L, 2)); - const char *s = lua_tostring(L, 3); - if (s && *s) - e->skeletalSprite.loadSkin(s); + Entity *e = entity(L); + if (e) + { + e->renderQuad = false; + e->setWidthHeight(128, 128); + e->skeletalSprite.loadSkeletal(getString(L, 2)); + const char *s = lua_tostring(L, 3); + if (s && *s) + e->skeletalSprite.loadSkin(s); + } luaReturnNil(); } +luaFunc(entity_loadSkin) +{ + Entity *e = entity(L); + if (e && e->skeletalSprite.isLoaded()) + { + const char *s = lua_tostring(L, 2); + if (s && *s) + e->skeletalSprite.loadSkin(s); + } + luaReturnNil(); +} luaFunc(entity_idle) { @@ -7099,21 +7113,24 @@ luaFunc(createBitmapText) luaFunc(text_setText) { BaseText *txt = getText(L); - txt->setText(getString(L, 2)); + if (txt) + txt->setText(getString(L, 2)); luaReturnNil(); } luaFunc(text_setFontSize) { BaseText *txt = getText(L); - txt->setFontSize(lua_tointeger(L, 2)); + if (txt) + txt->setFontSize(lua_tointeger(L, 2)); luaReturnNil(); } luaFunc(text_setWidth) { BaseText *txt = getText(L); - txt->setWidth(lua_tointeger(L, 2)); + if (txt) + txt->setWidth(lua_tointeger(L, 2)); luaReturnNil(); } @@ -7408,6 +7425,7 @@ static const struct { luaRegister(entity_initSegments), luaRegister(entity_warpSegments), luaRegister(entity_initSkeletal), + luaRegister(entity_loadSkin), luaRegister(entity_initStrands), luaRegister(entity_hurtTarget),