refactor: minor cleanup
This commit is contained in:
@@ -193,8 +193,8 @@ dynamic::Value Entities::serialize(const Entity& entity) {
|
|||||||
auto& rigmap = root->putMap("rig");
|
auto& rigmap = root->putMap("rig");
|
||||||
if (def.save.rig.textures) {
|
if (def.save.rig.textures) {
|
||||||
auto& map = rigmap.putMap("textures");
|
auto& map = rigmap.putMap("textures");
|
||||||
for (auto& entry : rig.textures) {
|
for (auto& [slot, texture] : rig.textures) {
|
||||||
map.put(entry.first, entry.second);
|
map.put(slot, texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (def.save.rig.pose) {
|
if (def.save.rig.pose) {
|
||||||
@@ -363,8 +363,8 @@ std::vector<Entity> Entities::getAllInside(AABB aabb) {
|
|||||||
if (found == uids.end()) {
|
if (found == uids.end()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (auto entity = get(found->second)) {
|
if (auto wrapper = get(found->second)) {
|
||||||
collected.push_back(*entity);
|
collected.push_back(*wrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ struct EntityDef {
|
|||||||
glm::vec3 hitbox {0.5f};
|
glm::vec3 hitbox {0.5f};
|
||||||
std::vector<std::pair<size_t, AABB>> boxTriggers {};
|
std::vector<std::pair<size_t, AABB>> boxTriggers {};
|
||||||
std::vector<std::pair<size_t, float>> radialTriggers {};
|
std::vector<std::pair<size_t, float>> radialTriggers {};
|
||||||
std::string rigName = name.substr(name.find(":")+1);
|
std::string rigName = name.substr(name.find(":") + 1);
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
@@ -35,7 +35,7 @@ struct EntityDef {
|
|||||||
entityid_t id;
|
entityid_t id;
|
||||||
rigging::RigConfig* rig;
|
rigging::RigConfig* rig;
|
||||||
} rt {};
|
} rt {};
|
||||||
|
|
||||||
EntityDef(const std::string& name) : name(name) {}
|
EntityDef(const std::string& name) : name(name) {}
|
||||||
EntityDef(const EntityDef&) = delete;
|
EntityDef(const EntityDef&) = delete;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,10 +12,8 @@ inline constexpr int DEF_PLAYER_INVENTORY_SIZE = 40;
|
|||||||
|
|
||||||
class Content;
|
class Content;
|
||||||
class World;
|
class World;
|
||||||
class Player;
|
|
||||||
class Chunks;
|
class Chunks;
|
||||||
class Entities;
|
class Entities;
|
||||||
class Inventory;
|
|
||||||
class Inventories;
|
class Inventories;
|
||||||
class LevelEvents;
|
class LevelEvents;
|
||||||
class Lighting;
|
class Lighting;
|
||||||
|
|||||||
Reference in New Issue
Block a user