diff options
| author | nathan <nathansmith@disroot.org> | 2025-12-27 23:00:54 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-12-27 23:00:54 +0000 |
| commit | 8f2d85aa019f089b6946f3b9e0355ce59b12b67a (patch) | |
| tree | ac26c36f4c41f21641cf2786d740567413cd6ac5 /src/entity.c | |
| parent | c6096a028d57da1026aa86ac215ea2f07461cd96 (diff) | |
| download | FindThings-8f2d85aa019f089b6946f3b9e0355ce59b12b67a.tar.gz FindThings-8f2d85aa019f089b6946f3b9e0355ce59b12b67a.tar.bz2 FindThings-8f2d85aa019f089b6946f3b9e0355ce59b12b67a.zip | |
Buildings going well
Diffstat (limited to 'src/entity.c')
| -rw-r--r-- | src/entity.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/entity.c b/src/entity.c index f6d51bf..fa3a414 100644 --- a/src/entity.c +++ b/src/entity.c @@ -228,10 +228,23 @@ void setEntityPosition(Entity* entity, Vector3 position) void placeEntityOnGround(Entity* entity, const World* world) { Vector3 position = entity->position; + + if (entity->id == ENTITY_NONE) + { + return; + } position.y = getWorldHeightAtLocation( world, entity->position.x, entity->position.z); - position.y += (entity->box.max.y - entity->box.min.y) / 2.0; + + if (entityIsBuilding(entity->id)) + { + position.y += ENTITY_BUILDING_GROUND_OFFSET; + } + else + { + position.y += (entity->box.max.y - entity->box.min.y) / 2.0; + } setEntityPosition(entity, position); } |
