Skip to content

Commit 014ea18

Browse files
committed
maputil: fix compilation error with Lua enabled
1 parent 28a1e66 commit 014ea18

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

maputil/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_library(libmaputil STATIC ${MAPUTIL_SOURCES})
1010
target_link_libraries(libmaputil common TBB::tbb TBB::tbbmalloc fmt::fmt)
1111

1212
if (LUA_LIBRARIES)
13+
message(STATUS "Found Lua")
1314
target_link_libraries(libmaputil ${LUA_LIBRARIES})
1415
target_include_directories(libmaputil PRIVATE ${LUA_INCLUDE_DIR})
1516
endif()

maputil/maputil.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,16 +333,16 @@ static void maputil_make_brush_side(lua_State *state, const brush_side_t &side)
333333
}
334334

335335
if (std::holds_alternative<texdef_valve_t>(side.raw) || std::holds_alternative<texdef_bp_t>(side.raw)) {
336-
const texdef_bp_t &raw_bp = std::holds_alternative<texdef_valve_t>(side.raw)
337-
? std::get<texdef_valve_t>(side.raw)
338-
: std::get<texdef_bp_t>(side.raw);
336+
const qmat<double, 2, 3> &axis = std::holds_alternative<texdef_valve_t>(side.raw)
337+
? std::get<texdef_valve_t>(side.raw).axis
338+
: std::get<texdef_bp_t>(side.raw).axis;
339339

340340
lua_createtable(state, 2, 0);
341341

342342
for (size_t i = 0; i < 2; i++) {
343343
lua_createtable(state, 3, 0);
344344
for (size_t v = 0; v < 3; v++) {
345-
lua_pushnumber(state, raw_bp.axis.at(i, v));
345+
lua_pushnumber(state, axis.at(i, v));
346346
lua_rawseti(state, -2, v + 1);
347347
}
348348
lua_rawseti(state, -2, i + 1);
@@ -550,7 +550,7 @@ static void maputil_copy_side(lua_State *state, brush_side_t &side)
550550
texdef_bp_t bp = maputil_load_bp(state);
551551
texdef_quake_ed_t qed = maputil_load_quaked(state);
552552

553-
side.raw = texdef_valve_t{qed, bp};
553+
side.raw = texdef_valve_t{.shift = qed.shift, .rotate = qed.rotate, .scale = qed.scale, .axis = bp.axis};
554554
}
555555
lua_pop(state, 1);
556556

0 commit comments

Comments
 (0)