Merge pull request #824 from MihailRis/patch-1

Patch 0.31.1
This commit is contained in:
MihailRis 2026-04-05 20:03:50 +03:00 • committed by GitHub
commit 8ea83ba469
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 74 additions and 45 deletions

View file

@ -108,13 +108,13 @@ static int l_set_skeleton(lua::State* L) {
}
if (auto entity = get_entity(L, 1)) {
std::string skeletonName = lua::require_string(L, 2);
auto rigConfig = assets->get<rigging::SkeletonConfig>(skeletonName);
auto rigConfig = assets->getShared<rigging::SkeletonConfig>(skeletonName);
if (rigConfig == nullptr) {
throw std::runtime_error(
"skeleton not found '" + skeletonName + "'"
);
}
entity->setRig(rigConfig);
entity->setRig(std::move(rigConfig));
}
return 0;
}

View file

@ -294,14 +294,14 @@ static int l_set_camera(lua::State* L) {
static int l_get_name(lua::State* L) {
if (auto player = get_player(L, 1)) {
return lua::pushstring(L, player->getName());
return lua::pushwstring(L, player->getName());
}
return 0;
}
static int l_set_name(lua::State* L) {
if (auto player = get_player(L, 1)) {
player->setName(lua::require_string(L, 2));
player->setName(lua::require_wstring(L, 2));
}
return 0;
}
@ -313,7 +313,7 @@ static int l_create(lua::State* L) {
}
auto& level = require_level();
auto player = level.players->create(playerId);
player->setName(lua::require_string(L, 1));
player->setName(lua::require_wstring(L, 1));
return lua::pushinteger(L, player->getId());
}