summaryrefslogtreecommitdiff
path: root/servers/physics/area_sw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics/area_sw.cpp')
-rw-r--r--servers/physics/area_sw.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp
index 398849edb8..1016afcaba 100644
--- a/servers/physics/area_sw.cpp
+++ b/servers/physics/area_sw.cpp
@@ -175,7 +175,7 @@ void AreaSW::set_monitorable(bool p_monitorable) {
void AreaSW::call_queries() {
- if (monitor_callback_id && !monitored_bodies.empty()) {
+ if (monitor_callback_id.is_valid() && !monitored_bodies.empty()) {
Variant res[5];
Variant *resptr[5];
@@ -185,7 +185,7 @@ void AreaSW::call_queries() {
Object *obj = ObjectDB::get_instance(monitor_callback_id);
if (!obj) {
monitored_bodies.clear();
- monitor_callback_id = 0;
+ monitor_callback_id = ObjectID();
return;
}
@@ -207,7 +207,7 @@ void AreaSW::call_queries() {
monitored_bodies.clear();
- if (area_monitor_callback_id && !monitored_areas.empty()) {
+ if (area_monitor_callback_id.is_valid() && !monitored_areas.empty()) {
Variant res[5];
Variant *resptr[5];
@@ -217,7 +217,7 @@ void AreaSW::call_queries() {
Object *obj = ObjectDB::get_instance(area_monitor_callback_id);
if (!obj) {
monitored_areas.clear();
- area_monitor_callback_id = 0;
+ area_monitor_callback_id = ObjectID();
return;
}
@@ -257,8 +257,6 @@ AreaSW::AreaSW() :
linear_damp = 0.1;
priority = 0;
set_ray_pickable(false);
- monitor_callback_id = 0;
- area_monitor_callback_id = 0;
monitorable = false;
}