feat: prop uses damage events
This commit is contained in:
parent
5fac1f1629
commit
9af31f6695
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue