@@ -2518,24 +2518,24 @@ int ObjectRef::l_set_lighting(lua_State *L)
25182518 }
25192519 lua_pop (L, 1 ); // volumetric_light
25202520
2521- lua_getfield (L, 2 , " lightIntensity " );
2521+ lua_getfield (L, 2 , " light_intensity " );
25222522 if (lua_istable (L, -1 )) {
2523- lua_getfield (L, 3 , " colorOffset " );
2523+ lua_getfield (L, 3 , " color_offset " );
25242524 if (lua_istable (L, -1 )) {
2525- lighting.lightIntensity .colorOffset_rgb [ 0 ] = getfloatfield_default (L, -1 , " r" , lighting.lightIntensity .colorOffset_rgb [ 0 ] );
2526- lighting.lightIntensity .colorOffset_rgb [ 1 ] = getfloatfield_default (L, -1 , " g" , lighting.lightIntensity .colorOffset_rgb [ 1 ] );
2527- lighting.lightIntensity .colorOffset_rgb [ 2 ] = getfloatfield_default (L, -1 , " b" , lighting.lightIntensity .colorOffset_rgb [ 2 ] );
2525+ lighting.lightIntensity .colorOffset_rgb . X = getfloatfield_default (L, -1 , " r" , lighting.lightIntensity .colorOffset_rgb . X );
2526+ lighting.lightIntensity .colorOffset_rgb . Y = getfloatfield_default (L, -1 , " g" , lighting.lightIntensity .colorOffset_rgb . Y );
2527+ lighting.lightIntensity .colorOffset_rgb . Z = getfloatfield_default (L, -1 , " b" , lighting.lightIntensity .colorOffset_rgb . Z );
25282528 }
2529- lua_pop (L, 1 ); // colorOffset
2530- lua_getfield (L, 3 , " colorRatioCoef " );
2529+ lua_pop (L, 1 ); // color_offset
2530+ lua_getfield (L, 3 , " color_ratio_coef " );
25312531 if (lua_istable (L, -1 )) {
2532- lighting.lightIntensity .colorRatioCoef_rgb [ 0 ] = getfloatfield_default (L, -1 , " r" , lighting.lightIntensity .colorRatioCoef_rgb [ 0 ] );
2533- lighting.lightIntensity .colorRatioCoef_rgb [ 1 ] = getfloatfield_default (L, -1 , " g" , lighting.lightIntensity .colorRatioCoef_rgb [ 1 ] );
2534- lighting.lightIntensity .colorRatioCoef_rgb [ 2 ] = getfloatfield_default (L, -1 , " b" , lighting.lightIntensity .colorRatioCoef_rgb [ 2 ] );
2532+ lighting.lightIntensity .colorRatioCoef_rgb . X = getfloatfield_default (L, -1 , " r" , lighting.lightIntensity .colorRatioCoef_rgb . X );
2533+ lighting.lightIntensity .colorRatioCoef_rgb . Y = getfloatfield_default (L, -1 , " g" , lighting.lightIntensity .colorRatioCoef_rgb . Y );
2534+ lighting.lightIntensity .colorRatioCoef_rgb . Z = getfloatfield_default (L, -1 , " b" , lighting.lightIntensity .colorRatioCoef_rgb . Z );
25352535 }
2536- lua_pop (L, 1 ); // colorRatioCoef
2536+ lua_pop (L, 1 ); // color_ratio_coef
25372537 }
2538- lua_pop (L, 1 ); // lightIntensity
2538+ lua_pop (L, 1 ); // light_intensity
25392539 }
25402540
25412541 getServer (L)->setLighting (player, lighting);
@@ -2578,24 +2578,24 @@ int ObjectRef::l_get_lighting(lua_State *L)
25782578 lua_pushnumber (L, lighting.volumetric_light_strength );
25792579 lua_setfield (L, -2 , " strength" );
25802580 lua_setfield (L, -2 , " volumetric_light" );
2581- lua_newtable (L); // "lightIntensity "
2582- lua_newtable (L); // "colorOffset "
2583- lua_pushnumber (L, lighting.lightIntensity .colorOffset_rgb [ 0 ] );
2581+ lua_newtable (L); // "light_intensity "
2582+ lua_newtable (L); // "color_offset "
2583+ lua_pushnumber (L, lighting.lightIntensity .colorOffset_rgb . X );
25842584 lua_setfield (L, -2 , " r" );
2585- lua_pushnumber (L, lighting.lightIntensity .colorOffset_rgb [ 1 ] );
2585+ lua_pushnumber (L, lighting.lightIntensity .colorOffset_rgb . Y );
25862586 lua_setfield (L, -2 , " g" );
2587- lua_pushnumber (L, lighting.lightIntensity .colorOffset_rgb [ 2 ] );
2587+ lua_pushnumber (L, lighting.lightIntensity .colorOffset_rgb . Z );
25882588 lua_setfield (L, -2 , " b" );
2589- lua_setfield (L, -2 , " colorOffset " );
2590- lua_newtable (L); // "colorRatioCoef "
2591- lua_pushnumber (L, lighting.lightIntensity .colorRatioCoef_rgb [ 0 ] );
2589+ lua_setfield (L, -2 , " color_offset " );
2590+ lua_newtable (L); // "color_ratio_coef "
2591+ lua_pushnumber (L, lighting.lightIntensity .colorRatioCoef_rgb . X );
25922592 lua_setfield (L, -2 , " r" );
2593- lua_pushnumber (L, lighting.lightIntensity .colorRatioCoef_rgb [ 1 ] );
2593+ lua_pushnumber (L, lighting.lightIntensity .colorRatioCoef_rgb . Y );
25942594 lua_setfield (L, -2 , " g" );
2595- lua_pushnumber (L, lighting.lightIntensity .colorRatioCoef_rgb [ 2 ] );
2595+ lua_pushnumber (L, lighting.lightIntensity .colorRatioCoef_rgb . Z );
25962596 lua_setfield (L, -2 , " b" );
2597- lua_setfield (L, -2 , " colorRatioCoef " );
2598- lua_setfield (L, -2 , " lightIntensity " );
2597+ lua_setfield (L, -2 , " color_ratio_coef " );
2598+ lua_setfield (L, -2 , " light_intensity " );
25992599 return 1 ;
26002600}
26012601
0 commit comments