Skip to content

Commit

Permalink
fix: to const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Dec 1, 2023
1 parent 6bf229e commit 719554b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lua/functions/creatures/npc/npc_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,14 @@ int NpcFunctions::luaNpcOpenShopWindow(lua_State* L) {

int NpcFunctions::luaNpcOpenShopWindowCallback(lua_State* L) {
// npc:openShopWindowCallback(player, items)
auto &npc = getUserdataShared<Npc>(L, 1);
const auto &npc = getUserdataShared<Npc>(L, 1);
if (!npc) {
reportErrorFunc(getErrorDesc(LUA_ERROR_NPC_NOT_FOUND));
pushBoolean(L, false);
return 1;
}

auto &player = getUserdataShared<Player>(L, 2);
const auto &player = getUserdataShared<Player>(L, 2);
if (!player) {
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
return 1;
Expand Down

0 comments on commit 719554b

Please sign in to comment.