Skip to content

Commit

Permalink
Fix crash when stars are reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Zughy committed Aug 10, 2022
1 parent 4fbcc33 commit bcc5680
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/script/lua_api/l_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ int ObjectRef::l_get_player_control(lua_State *L)
lua_newtable(L);
if (player == nullptr)
return 1;

const PlayerControl &control = player->getPlayerControl();
lua_pushboolean(L, control.direction_keys & (1 << 0));
lua_setfield(L, -2, "up");
Expand Down Expand Up @@ -2082,11 +2082,10 @@ int ObjectRef::l_set_stars(lua_State *L)

star_params.scale = getfloatfield_default(L, 2,
"scale", star_params.scale);
star_params.day_opacity = getfloatfield_default(L, 2,
"day_opacity", star_params.day_opacity);
}

star_params.day_opacity = getfloatfield_default(L, 2,
"day_opacity", star_params.day_opacity);

getServer(L)->setStars(player, star_params);
return 0;
}
Expand Down

0 comments on commit bcc5680

Please sign in to comment.