File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -972,10 +972,10 @@ int ModApiMapgen::l_register_decoration(lua_State *L)
972
972
bool read_deco_simple (lua_State *L, DecoSimple *deco)
973
973
{
974
974
int index = 1 ;
975
+ int param2;
975
976
976
977
deco->deco_height = getintfield_default (L, index , " height" , 1 );
977
978
deco->deco_height_max = getintfield_default (L, index , " height_max" , 0 );
978
- deco->deco_param2 = getintfield_default (L, index , " param2" , 0 );
979
979
980
980
if (deco->deco_height <= 0 ) {
981
981
errorstream << " register_decoration: simple decoration height"
@@ -991,11 +991,13 @@ bool read_deco_simple(lua_State *L, DecoSimple *deco)
991
991
return false ;
992
992
}
993
993
994
- if ((deco->deco_param2 < 0 ) || (deco->deco_param2 > 255 )) {
994
+ param2 = getintfield_default (L, index , " param2" , 0 );
995
+ if ((param2 < 0 ) || (param2 > 255 )) {
995
996
errorstream << " register_decoration: param2 out of bounds (0-255)"
996
997
<< std::endl;
997
998
return false ;
998
999
}
1000
+ deco->deco_param2 = (u8)param2;
999
1001
1000
1002
return true ;
1001
1003
}
You can’t perform that action at this time.
0 commit comments