diff --git a/CMakeLists.txt b/CMakeLists.txt
index a10dd7d..b76e283 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -298,7 +298,7 @@ add_executable(my_rpg
include/components/attack_component.h
src/systems/combat_methods.c
src/combat/fireball.c
-)
+ src/player_utilities.c include/player_utilities.h)
add_compile_options(-W -Wall -Wextra -Wshadow)
diff --git a/include/player_utilities.h b/include/player_utilities.h
new file mode 100644
index 0000000..fe13434
--- /dev/null
+++ b/include/player_utilities.h
@@ -0,0 +1,15 @@
+/*
+** EPITECH PROJECT, 2019
+** MUL_my_runner_2019
+** File description:
+** game_loader
+*/
+
+#ifndef MY_RPG_PLAYER_UTILITIES_H
+#define MY_RPG_PLAYER_UTILITIES_H
+
+#include "entity.h"
+
+void set_combat_player(gc_entity *main_player, gc_entity *combat_player);
+
+#endif //MY_RPG_PLAYER_UTILITIES_H
diff --git a/prefabs/combat.gcprefab b/prefabs/combat.gcprefab
index 5da72a4..d3f54ff 100644
--- a/prefabs/combat.gcprefab
+++ b/prefabs/combat.gcprefab
@@ -52,8 +52,5 @@
-
-
-
\ No newline at end of file
diff --git a/src/player_utilities.c b/src/player_utilities.c
new file mode 100644
index 0000000..aae16b3
--- /dev/null
+++ b/src/player_utilities.c
@@ -0,0 +1,23 @@
+/*
+** EPITECH PROJECT, 2019
+** MUL_my_runner_2019
+** File description:
+** game_loader
+*/
+
+#include "components//health_component.h"
+#include "entity.h"
+
+void set_combat_player(gc_entity *main_player, gc_entity *combat_player)
+{
+ struct health_component *h_cmp_main = \
+GETCMP(main_player, health_component);
+ struct health_component *h_cmp_combat = \
+GETCMP(combat_player, health_component);
+
+ if (!h_cmp_main || !h_cmp_combat)
+ return;
+ h_cmp_combat->health_max = h_cmp_main->health_max;
+ h_cmp_combat->health = h_cmp_main->health;
+ h_cmp_combat->dead = h_cmp_main->dead;
+}
\ No newline at end of file
diff --git a/src/systems/combat_manager.c b/src/systems/combat_manager.c
index 1ac3ec4..3925b24 100644
--- a/src/systems/combat_manager.c
+++ b/src/systems/combat_manager.c
@@ -13,6 +13,7 @@
#include "my.h"
#include "components/dialog_holder.h"
#include "enemy.h"
+#include "player_utilities.h"
void entity_moved(gc_engine *engine, va_list args)
{
@@ -31,9 +32,12 @@ void entity_moved(gc_engine *engine, va_list args)
void dialog_ended(gc_engine *engine, va_list args)
{
struct combat_manager *this = GETSYS(engine, combat_manager);
+ gc_entity *player = engine->scene->get_entity(engine->scene, 50);
+ gc_entity *player_combat = this->game_scene->get_entity(this->game_scene, 50);
- if (!this->current_enemy)
+ if (!this->current_enemy || !player || ! player_combat)
return;
+ set_combat_player(player_combat, player);
engine->trigger_event(engine, "combat_ended", this->current_enemy);
this->current_enemy = NULL;
engine->change_scene(engine, this->game_scene);
diff --git a/src/systems/combat_methods.c b/src/systems/combat_methods.c
index 26162ff..8adb233 100644
--- a/src/systems/combat_methods.c
+++ b/src/systems/combat_methods.c
@@ -17,20 +17,7 @@
#include "components/health_component.h"
#include "enemy.h"
#include "setup.h"
-
-void set_combat_player(gc_entity *main_player, gc_entity *combat_player)
-{
- struct health_component *h_cmp_main = \
-GETCMP(main_player, health_component);
- struct health_component *h_cmp_combat = \
-GETCMP(combat_player, health_component);
-
- if (!h_cmp_main || !h_cmp_combat)
- return;
- h_cmp_combat->health_max = h_cmp_main->health_max;
- h_cmp_combat->health = h_cmp_main->health;
- h_cmp_combat->dead = h_cmp_main->dead;
-}
+#include "player_utilities.h"
void combat_start(gc_engine *engine, char *enemy_name)
{