Daniele Bartolini 5 лет назад
Родитель
Сommit
67a152278a
2 измененных файлов с 5 добавлено и 3 удалено
  1. 5 1
      src/world/world.cpp
  2. 0 2
      src/world/world.h

+ 5 - 1
src/world/world.cpp

@@ -577,11 +577,15 @@ void World::post_level_loaded_event()
 	event_stream::write(_events, EventType::LEVEL_LOADED, ev);
 }
 
-#if CROWN_DEVELOPMENT
+#if CROWN_DEBUG
 void World::disable_unit_callbacks()
 {
 	_script_world->_disable_callbacks = true;
 }
+#else
+void World::disable_unit_callbacks()
+{
+}
 #endif
 
 void spawn_units(World& w, const UnitResource* ur, const Vector3& pos, const Quaternion& rot, const Vector3& scl, const UnitId* unit_lookup)

+ 0 - 2
src/world/world.h

@@ -215,12 +215,10 @@ struct World
 	///
 	void post_level_loaded_event();
 
-#if CROWN_DEVELOPMENT
 	/// After this call, units will no longer receive spawned(), unspawned() or any
 	/// other callback. This is used only by the editor to prevent user logic to
 	/// interfere with editor's assumptions.
 	void disable_unit_callbacks();
-#endif
 };
 
 void spawn_units(World& w, const UnitResource* ur, const Vector3& pos, const Quaternion& rot, const Vector3& scl, const UnitId* unit_lookup);