feat: prop uses damage events

This commit is contained in:
Sara 2023-12-01 21:45:52 +01:00
parent 5fac1f1629
commit 9af31f6695

View file

@ -1,4 +1,5 @@
#include "Prop.h" #include "Prop.h"
#include "DamageEvent.h"
#include "debug.h" #include "debug.h"
#include "game_world.h" #include "game_world.h"
#include "physics_world.h" #include "physics_world.h"
@ -61,9 +62,9 @@ RigidBody* PropGetRigidBody(Prop* self) {
} }
void* PropReceiveMessage(Prop* self, MessageID message, uintptr_t data) { void* PropReceiveMessage(Prop* self, MessageID message, uintptr_t data) {
DamageEventData* damage = (DamageEventData*)data;
if(message == 1) { if(message == 1) {
unsigned damage = (int)data; LOG_INFO("Punching bag took %d damage", damage->damageAmount);
LOG_INFO("Punching bag took %u damage", damage);
} }
return 0; return 0;
} }