aboutsummaryrefslogtreecommitdiff
path: root/src/entities/soldato.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities/soldato.c')
-rw-r--r--src/entities/soldato.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/entities/soldato.c b/src/entities/soldato.c
index 74544aa..2cc0e07 100644
--- a/src/entities/soldato.c
+++ b/src/entities/soldato.c
@@ -3,6 +3,8 @@
void initSoldato(Entity * entity, Game * game) {
entity->model = &game->assets.models[SOLDATO_ASSET];
+ entity->collisionModel = entityCreateCollisionModel(*entity->model);
+ entity->transformedCollisionModel = entityCreateCollisionModel(*entity->model);
setEntityRadius(entity);
// Acceleration.
@@ -46,9 +48,14 @@ void initSoldato(Entity * entity, Game * game) {
void closeSoldato(Entity * entity) {
if (entity->data != NULL)
KF_FREE(entity->data);
+
+ entityFreeCollisionModel(entity->collisionModel);
+ entityFreeCollisionModel(entity->transformedCollisionModel);
}
void updateSoldato(Game * game, Entity * entity) {
+ entityUpdateLastValues(entity);
+
Entity * player = getEntityFromWorld(game->world, 0);
Soldato * data = (Soldato*)entity->data;
@@ -57,6 +64,8 @@ void updateSoldato(Game * game, Entity * entity) {
player->position,
&data->flyToPoint
);
+
+ entityCheckTransformedCollisionModel(entity);
}
void drawSoldato(Game * game, Entity * entity) {