From 39f89d51276693b49671e613d0348e23b53ce31d Mon Sep 17 00:00:00 2001 From: Sara Date: Sat, 2 Dec 2023 15:46:36 +0100 Subject: [PATCH] feat: Prop now detects damage with #define-d message constant As opposed to a magic number 1 --- game/src/Prop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game/src/Prop.c b/game/src/Prop.c index 5bea7a9..ea5f7ab 100644 --- a/game/src/Prop.c +++ b/game/src/Prop.c @@ -1,5 +1,6 @@ #include "Prop.h" #include "DamageEvent.h" +#include "Messages.h" #include "debug.h" #include "game_world.h" #include "physics_world.h" @@ -63,7 +64,7 @@ RigidBody* PropGetRigidBody(Prop* self) { void* PropReceiveMessage(Prop* self, MessageID message, uintptr_t data) { DamageEventData* damage = (DamageEventData*)data; - if(message == 1) { + if(message == MESSAGE_DEAL_DAMAGE) { LOG_INFO("Punching bag took %d damage", damage->damageAmount); } return 0;