set combat player is no more signal 11 friendly

This commit is contained in:
Clément Le Bihan
2020-05-01 19:20:28 +02:00
parent 58753a2d52
commit f97fba3b71
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
<gc_entity id="50">
<transform_component>
<Size x="200%" y="200%" />
<Size x="100" y="100" />
</transform_component>
<map_linker x="0" y="0" />
<player_component />
+8 -3
View File
@@ -11,10 +11,15 @@
void set_combat_player(gc_engine *engine, gc_entity *player, gc_entity *cbt)
{
struct health_component *main = GETCMP(player, health_component);
struct health_component *combat = GETCMP(cbt, health_component);
struct combat_manager *this = GETSYS(engine, combat_manager);
struct health_component *main;
struct health_component *combat;
struct combat_manager *this;
if (!engine || !player || !cbt)
return;
main = GETCMP(player, health_component);
combat = GETCMP(cbt, health_component);
this = GETSYS(engine, combat_manager);
this->last_attack = NULL;
this->last_damage = 0;
if (!main || !combat)