mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
refactor entities events
This commit is contained in:
parent
0df5d34e04
commit
54902d7f49
4 changed files with 49 additions and 66 deletions
|
|
@ -165,7 +165,7 @@ void Entities::despawn(entityid_t id) {
|
|||
auto& eid = entity->getID();
|
||||
if (!eid.destroyFlag) {
|
||||
eid.destroyFlag = true;
|
||||
scripting::on_entity_despawn(entity->getDef(), *entity);
|
||||
scripting::on_entity_despawn(*entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,15 @@
|
|||
#include <entt/entity/registry.hpp>
|
||||
|
||||
struct entity_funcs_set {
|
||||
bool init : 1;
|
||||
bool on_despawn : 1;
|
||||
bool on_grounded : 1;
|
||||
bool on_fall : 1;
|
||||
bool on_sensor_enter : 1;
|
||||
bool on_sensor_exit : 1;
|
||||
bool on_save : 1;
|
||||
bool init;
|
||||
bool on_despawn;
|
||||
bool on_grounded;
|
||||
bool on_fall;
|
||||
bool on_sensor_enter;
|
||||
bool on_sensor_exit;
|
||||
bool on_save;
|
||||
bool on_aim_on;
|
||||
bool on_aim_off;
|
||||
};
|
||||
|
||||
struct EntityDef;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue