From c526c257cc871811d3788137e18390fe42258a16 Mon Sep 17 00:00:00 2001 From: Jonathan Hager Date: Mon, 23 Jan 2023 22:48:14 +0100 Subject: [PATCH] =?UTF-8?q?Mehr=20Builder=20h=C3=A4mmern=20jetzt=20schnell?= =?UTF-8?q?er=20des=20Geb=C3=A4ude=20hoch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/entityacts.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Entity/entityacts.c b/Entity/entityacts.c index b7d4062..d7185fa 100644 --- a/Entity/entityacts.c +++ b/Entity/entityacts.c @@ -36,16 +36,17 @@ void BuilderAct(Game *game, Entity *entity){ if(entity->task->progress == 0){ // Angekommen, noch nicht mit arbeiten begonnen AnimationChangeType(entity->animationHandler, AN_ENTITY_ARBEITEN); - entity->task->progress += 0.01; + entity->task->progress = 1; } - else if(entity->task->progress >= 1.0){ + else if(target->progress >= 1.0){ // Fertig mit arbeiten, Animation zu Idle zurück AnimationChangeType(entity->animationHandler, AN_ENTITY_IDLE); BuildingFinishConstruction(game, (Building *) entity->task->target); entity->task->target = 0; + entity->task->progress = 0; } else{ - entity->task->progress += 0.2 * GetFrameTime(); + target->progress += 0.2 * GetFrameTime(); } } }