refactor entities events

This commit is contained in:
MihailRis
2024-07-16 13:27:39 +03:00
parent 0df5d34e04
commit 54902d7f49
4 changed files with 49 additions and 66 deletions
+1 -1
View File
@@ -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);
}
}
}
+9 -7
View File
@@ -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;