1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Replace Optional with std::optional

This commit is contained in:
Desour 2023-06-11 22:55:36 +02:00 committed by sfan5
parent 34ad551efc
commit e700182f44
15 changed files with 39 additions and 198 deletions

View file

@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "cpp_api/s_base.h"
#include "irr_v3d.h"
#include "util/Optional.h"
#include <optional>
struct PointedThing;
struct ItemStack;
@ -37,7 +37,7 @@ class ScriptApiItem
{
public:
/*
* Functions with Optional<ItemStack> are for callbacks where Lua may
* Functions with std::optional<ItemStack> are for callbacks where Lua may
* want to prevent the engine from modifying the inventory after it's done.
* This has a longer backstory where on_use may need to empty the player's
* inventory without the engine interfering (see issue #6546).
@ -45,11 +45,11 @@ public:
bool item_OnDrop(ItemStack &item,
ServerActiveObject *dropper, v3f pos);
bool item_OnPlace(Optional<ItemStack> &item,
bool item_OnPlace(std::optional<ItemStack> &item,
ServerActiveObject *placer, const PointedThing &pointed);
bool item_OnUse(Optional<ItemStack> &item,
bool item_OnUse(std::optional<ItemStack> &item,
ServerActiveObject *user, const PointedThing &pointed);
bool item_OnSecondaryUse(Optional<ItemStack> &item,
bool item_OnSecondaryUse(std::optional<ItemStack> &item,
ServerActiveObject *user, const PointedThing &pointed);
bool item_OnCraft(ItemStack &item, ServerActiveObject *user,
const InventoryList *old_craft_grid, const InventoryLocation &craft_inv);