add player.get_camera(playerid)

This commit is contained in:
MihailRis
2024-07-22 14:16:28 +03:00
parent 2b50e85cdc
commit 34ab3eb41c
2 changed files with 17 additions and 3 deletions
+2 -3
View File
@@ -160,8 +160,6 @@ void Player::postUpdate() {
skeleton.visible = currentCamera != camera;
auto velocityMod = glm::length(hitbox.velocity);
size_t bodyIndex = skeleton.config->find("body")->getIndex();
size_t headIndex = skeleton.config->find("head")->getIndex();
@@ -271,7 +269,8 @@ std::unique_ptr<dynamic::Map> Player::serialize() const {
root->put("chosen-slot", chosenSlot);
root->put("entity", eid);
root->put("inventory", inventory->serialize());
auto found = std::find(level->cameras.begin(), level->cameras.end(), currentCamera);
auto found = std::find(
level->cameras.begin(), level->cameras.end(), currentCamera);
if (found != level->cameras.end()) {
root->put("camera", level->content->getIndices(
ResourceType::CAMERA).getName(found - level->cameras.begin()));