feat: Prop now detects damage with #define-d message constant

As opposed to a magic number 1
This commit is contained in:
Sara 2023-12-02 15:46:36 +01:00
parent 9af31f6695
commit 39f89d5127

View file

@ -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;