mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
refactor: PVS-Studio warnings fixes
This commit is contained in:
parent
7bc96affbb
commit
245b39be62
22 changed files with 311 additions and 302 deletions
|
|
@ -4,12 +4,9 @@
|
|||
|
||||
using namespace scripting;
|
||||
|
||||
static ItemDef* get_item_def(lua::State* L, int idx) {
|
||||
static const ItemDef* get_item_def(lua::State* L, int idx) {
|
||||
auto indices = content->getIndices();
|
||||
auto id = lua::tointeger(L, idx);
|
||||
if (static_cast<size_t>(id) >= indices->items.count()) {
|
||||
return nullptr;
|
||||
}
|
||||
return indices->items.get(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue