@@ -2493,46 +2493,46 @@ HOOK_METHOD(GridEntity, hurt_func, (Entity* ent, int Damage, int DamageFlags, fl
24932493}
24942494
24952495// MC_POST_LEVEL_LAYOUT_GENERATED
2496- // HOOK_METHOD(LevelGenerator, Generate, (int unk, bool unk2, bool unk3, bool unk4, unsigned int const& allowedShapes, unsigned int numDeadEnds, LevelGenerator_Room* startRoom) -> void) {
2497- // super(unk, unk2, unk3, unk4, allowedShapes, numDeadEnds, startRoom);
2498- //
2499- // const int callbackId = 1099;
2500- // if (!CallbackState.test(callbackId - 1000)) {
2501- // return;
2502- // }
2503- //
2504- // lua_State* L = g_LuaEngine->_state;
2505- // lua::LuaStackProtector protector(L);
2506- //
2507- // lua_rawgeti(L, LUA_REGISTRYINDEX, g_LuaEngine->runCallbackRegistry->key);
2508- // lua::LuaResults result = lua::LuaCaller(L).push(callbackId)
2509- // .push(12)
2510- // .push(this, lua::metatables::LevelGeneratorMT)
2511- // .call(0);
2512- //
2513- // /* std::ofstream stream("repentogon.log", std::ios::app);
2514- // stream << "After the call to Generate: " << std::endl;
2515- // stream << " - Dead ends (" << GetDeadEnds()->size() << "): ";
2516- // for (int idx : *GetDeadEnds()) {
2517- // stream << idx << " ";
2518- // }
2519- // stream << std::endl;
2520- // stream << " - Non dead ends (" << GetNonDeadEnds()->size() << "): ";
2521- // for (int idx : *GetNonDeadEnds()) {
2522- // stream << idx << " ";
2523- // }
2524- // stream << std::endl;
2525- // stream << " - Rooms are as follows : " << std::endl;
2526- // for (LevelGenerator_Room const& room : *allRooms) {
2527- // stream << "\tRoom " << room._generationIndex << " at (" << room._gridColIdx << ", " << room._gridLineIdx << ") of shape " << room._shape << " with allowed door slots " << room._doors << " connects to ";
2528- // for (auto const& neighbor : room._neighbors) {
2529- // stream << neighbor << " ";
2530- // }
2531- // stream << std::endl;
2532- // }
2533- //
2534- // stream.flush(); */
2535- // }
2496+ HOOK_METHOD (LevelGenerator, Generate, (int unk, bool unk2, bool unk3, bool unk4, unsigned int const & allowedShapes, unsigned int numDeadEnds, LevelGenerator_Room* startRoom) -> void) {
2497+ super (unk, unk2, unk3, unk4, allowedShapes, numDeadEnds, startRoom);
2498+
2499+ const int callbackId = 1099 ;
2500+ if (!CallbackState.test (callbackId - 1000 )) {
2501+ return ;
2502+ }
2503+
2504+ lua_State* L = g_LuaEngine->_state ;
2505+ lua::LuaStackProtector protector (L);
2506+
2507+ lua_rawgeti (L, LUA_REGISTRYINDEX, g_LuaEngine->runCallbackRegistry ->key );
2508+ lua::LuaResults result = lua::LuaCaller (L).push (callbackId)
2509+ .push (12 )
2510+ .push (this , lua::metatables::LevelGeneratorMT)
2511+ .call (0 );
2512+
2513+ /* std::ofstream stream("repentogon.log", std::ios::app);
2514+ stream << "After the call to Generate: " << std::endl;
2515+ stream << " - Dead ends (" << GetDeadEnds()->size() << "): ";
2516+ for (int idx : *GetDeadEnds()) {
2517+ stream << idx << " ";
2518+ }
2519+ stream << std::endl;
2520+ stream << " - Non dead ends (" << GetNonDeadEnds()->size() << "): ";
2521+ for (int idx : *GetNonDeadEnds()) {
2522+ stream << idx << " ";
2523+ }
2524+ stream << std::endl;
2525+ stream << " - Rooms are as follows : " << std::endl;
2526+ for (LevelGenerator_Room const& room : *allRooms) {
2527+ stream << "\tRoom " << room._generationIndex << " at (" << room._gridColIdx << ", " << room._gridLineIdx << ") of shape " << room._shape << " with allowed door slots " << room._doors << " connects to ";
2528+ for (auto const& neighbor : room._neighbors) {
2529+ stream << neighbor << " ";
2530+ }
2531+ stream << std::endl;
2532+ }
2533+
2534+ stream.flush(); */
2535+ }
25362536
25372537// POST_NIGHTMARE_SCENE_RENDER (1102)
25382538/* HOOK_METHOD(NightmareScene, Render, () -> void) {
0 commit comments